ROLLBACK

A ROLLBACK statement in SQL ends then current transaction within RDBMS and returns the database to some previous state.

A ROLLBACK statement also erases all existing savepoints and releases transaction locks.

The general format is:

ROLLBACK [WORK] [TO [SAVEPOINT]'savepoint_text_identifier'];
ROLLBACK [WORK] [FORCE 'force_text'];

Oracle recommends that you explicitly end every transaction in your application programs with a COMMIT or ROLLBACK statement before disconnecting from Oracle Database.
If you do not explicitly commit the transaction and the program terminates abnormally, then the last uncommitted transaction is automatically rolled back.

Example 1:

INSERT INTO country VALUES (34, 'Spain');
ROLLBACK;

Example 2:

SAVEPOINT savepoint1;
DELETE FROM country WHERE countrycode=34;
ROLLBACK TO SAVEPOINT savepoint1;