When processing data it is an useful abstraction to split the processing in transactions: where each transaction may consists of several individual operations, but must move the system data among consistent states. In the context of a database this is easily achieved using transactions and the commit/rollback mechanism. The term database originated within the computer industry. ... In the context of computer science and data management, commit refers to the idea of making permanent a set of tentative changes, such as at the end of a transaction. ... In database technologies, a rollback is an operation which returns the database to some previous state. ...
For systems where there isn't any commit/rollback mechanism available one can undo a failed transaction with a Compensating Transaction, which will bring the system back to its initial state. It is just a workaround which has to be implemented manually and cannot guarantee that the system always ends in a consistent state. What if the Compensating Transaction also fails? Depending on the situation (regulation, criticality, development team skills, budget...) an implementation will strive to achieve more or less reliability. A minimal requirement in case of failure is to expose the fact in some way: logging, email, ... In the context of computer science and data management, commit refers to the idea of making permanent a set of tentative changes, such as at the end of a transaction. ... In database technologies, a rollback is an operation which returns the database to some previous state. ...