Final answer:
To restore old states when a transaction aborts, you can use the concept of database transactions and undo logs.
Step-by-step explanation:
When a transaction aborts, it means that the changes made in that transaction are rolled back and the database is returned to its previous state. To restore old states, you need to use the concept of database transactions. Transactions allow you to group multiple database operations into a single logical unit. If a transaction aborts, you can use the concept of a transaction log or undo logs to revert the changes made by the transaction and restore the database to its previous state.
For example, let's say you have a database table called 'customers' and you want to update the 'balance' column for a particular customer. You start a transaction, make the necessary changes, and then commit the transaction. If the transaction encounters an error and aborts, the changes made to the 'balance' column will be rolled back, and the 'balance' value will be restored to its previous state.