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.
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 |
|---|---|---|
Revert changes made to the database up to a specified tag. | All editions | |
Preview the SQL Liquibase will generate before running rollback. | All editions | |
Revert changes to a previous state based on a specified date and/or time. | All editions | |
Preview the SQL before running rollback-to-date. | All editions | |
Revert a specified number of changesets. | All editions | |
Preview the SQL before running rollback-count. | All editions | |
Preview the SQL for undeployed changes added to the changelog. | All editions | |
Preview the SQL for undeployed changes up to a specified tag. | All editions | |
Preview the SQL before rolling back a specified number of undeployed changes. | All editions | |
Revert a single changeset without affecting changes made before or after it. | Liquibase Secure | |
Preview the SQL before running rollback-one-changeset. | Liquibase Secure | |
Revert all changes applied to the database during a specific deploymentID. | Liquibase Secure | |
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.
Requirements
All rollback commands require the following:
--changelog-file: The path to the root changelog file.--url: The JDBC database connection URL.--usernameand--password: Required for some databases. Not needed for systems that use alternate authentication methods.