ROLLBACK
ROLLBACK is a SQL statement in the Transactions category. Undoes all changes made in the current transaction (or to a savepoint). The syntax is ROLLBACK [TO SAVEPOINT name];. It returns none (changes reverted). A typical example: START TRANSACTION; DELETE FROM important_table; ROLLBACK; -- Phew! Data restored A close relative is BEGIN / START TRANSACTION, which begins a new transaction. Changes made within are invisible to others until COMMIT. A close relative is COMMIT, which saves all changes made in the current transaction permanently. A close relative is SAVEPOINT, which sets a named point within a transaction that you can ROLLBACK to without affecting previous work. More about this category: Transaction control — BEGIN, COMMIT, ROLLBACK, SAVEPOINT, ACID properties. Related Transactions entries: BEGIN / START TRANSACTION, COMMIT, SAVEPOINT, SET TRANSACTION / ISOLATION LEVEL, AUTOCOMMIT, DEADLOCK, XACT_ABORT, READ ONLY / READ WRITE.