Varan Join the beta →
Varan › What is database rollback

What is database rollback?

A rollback undoes changes to your data. But "rollback" means two very different things depending on whether your change is still open or already committed — and mixing them up is where people get burned.

Rollback in a transaction: ROLLBACK vs COMMIT

In SQL, work happens inside a transaction. Your changes stay provisional — visible only to your session — until you decide their fate:

BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = 1;
UPDATE accounts SET balance = balance + 100 WHERE id = 2;
-- both succeed → keep them:
COMMIT;
-- something's wrong → throw them away:
ROLLBACK;

This is the ACID safety net: an all-or-nothing unit of work. If your session crashes mid-transaction, the database automatically rolls the uncommitted work back on recovery.

The catch: you can't roll back a committed change

Here's what trips people up. ROLLBACK only works before COMMIT. The moment you commit, the change is permanent and ROLLBACK can do nothing about it. Run a bad UPDATE without a WHERE, commit it, and transaction control won't save you.

To reverse a change you've already committed, you need something else entirely:

MechanismWhat it does
Oracle FlashbackTime-travel to data as it was, using undo/flashback logs — Oracle-specific.
Point-in-time recoveryRestore the database to a past moment from backups + logs. Heavy, all-or-nothing.
Restore from backupRoll the whole database back to a snapshot. Loses everything after it.
Version historyKeep a git-style record of changes and revert a specific one, like reverting a commit.

Rollback as history: undoing committed edits

Most people who search for "how do I roll back" have already committed. What they actually want isn't transaction control — it's a history they can step back through. That's a different model: instead of a pre-commit safety net that vanishes the instant you commit, you keep versions of your data over time and revert to an earlier one whenever you need to.

This is exactly how data version control works, and it's what Varan gives you — a git-style history across PostgreSQL, MySQL, DuckDB and files, so you can undo an already-applied change without a DBA restore or a vendor-specific flashback feature.

The Varan workspace — where cross-source queries, version history and rollback live.

ROLLBACK vs Flashback vs history — the one-line version

ROLLBACK discards an open, uncommitted transaction. Flashback / recovery reverses committed changes, but is engine-specific and often DBA-grade. Git-style history reverses committed changes with a simple, vendor-agnostic model — and works across databases and files at once.

Undo changes without a DBA restore

Varan keeps a version history across your sources — revert a change like reverting a commit. Free during the beta.

Request beta access →

FAQ

Can I roll back after COMMIT?

Not with ROLLBACK — a commit is permanent. You need flashback, point-in-time recovery, or a version history to undo committed changes.

What's the difference between ROLLBACK and Oracle Flashback?

ROLLBACK discards an uncommitted transaction; Flashback reverses already-committed changes. See the full version-control comparison.

Does this work across more than one database?

Varan's history spans PostgreSQL, MySQL, DuckDB and files together — see cross-source SQL.