Introducing Agent Safe Governance for the AI Era

Rollback commands

Last updated: June 9, 2026

The purpose of rollback commands is to revert deployed database changes. Rollback commands undo changes that have been deployed to a specified point such as a date, number of changes, or by tag name. When database changes are rolled back, the row associated with that change is deleted from the DATABASECHANGELOG table.

Before you can use rollback commands, you need to have your Liquibase project set up. You'll need to make sure you have a liquibase.properties file that specifies the driver, classpath, and URL. You may also need to set up any needed authentication so Liquibase is connected to your database.

If you use modeled changelogs (XML, YAML, JSON), you can define custom rollback logic for your changesets. Custom rollback definitions are not supported in formatted SQL changelogs. You must write rollback SQL manually in the changelog file.

For rollback command syntax and usage examples, see rollback.

Risks and considerations

Because data is constantly changing, there is a risk of data loss when a rollback is executed. There is also a risk of database drift if the rollback is not executed in all impacted database environments.

Before running any rollback command, run the corresponding SQL preview command first to inspect the SQL Liquibase will generate. For example, run rollback-sql before rollback. This helps you identify potential issues before they affect your database.

Note: In Liquibase 4.27.0 and later, you can enable the DATABASECHANGELOGHISTORY table to see a full history of rollbacks and other changes to your database.

Rollback commands

Command

Description

Edition

rollback

Revert changes made to the database up to a specified tag.

All editions

rollback-sql

Preview the SQL Liquibase will generate before running rollback.

All editions

rollback-to-date

Revert changes to a previous state based on a specified date and/or time.

All editions

rollback-to-date-sql

Preview the SQL before running rollback-to-date.

All editions

rollback-count

Revert a specified number of changesets.

All editions

rollback-count-sql

Preview the SQL before running rollback-count.

All editions

future-rollback-sql

Preview the SQL for undeployed changes added to the changelog.

All editions

future-rollback-from-tag-sql

Preview the SQL for undeployed changes up to a specified tag.

All editions

future-rollback-count-sql

Preview the SQL before rolling back a specified number of undeployed changes.

All editions

rollback-one-changeset

Revert a single changeset without affecting changes made before or after it.

Liquibase Secure

rollback-one-changeset-sql

Preview the SQL before running rollback-one-changeset.

Liquibase Secure

rollback-one-update

Revert all changes applied to the database during a specific deploymentID.

Liquibase Secure

rollback-one-update-sql

Preview the SQL before running rollback-one-update.

Liquibase Secure

Each individual rollback command page specifies the criteria for successfully using the command, including a list of required and optional command-specific arguments.