What are targeted rollbacks?
Last updated: July 9, 2026
Targeted rollbacks provide users the ability to target the exact changeset or deployment update for rollback without rolling back all the changes that came after.
Targeted rollback commands leave unrelated changes in place and remove the changeset record from the DATABASECHANGELOG table. Rollback history is retained in the DATABASECHANGELOGHISTORY 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.
Targeted Rollback Commands
These commands require an active Liquibase Secure license:
rollback-one-changeset: used to revert a single change without impact to changes made before or after the targeted change.rollback-one-changeset-sql: executed before therollback-one-changesetcommand to inspect the raw SQL for potential issues.rollback-one-update: used to revert all changes that were applied to the database related to a specific deployment ID.rollback-one-update-sql: executed before therollback-one-updatecommand to inspect the raw SQL for potential issues.
Each individual targeted rollback command page will specify the criteria for using the command successfully, including a list of required and optional command-specific arguments.
Warning: 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.
Targeted Rollback Command Requirements
All targeted rollback commands require the following command arguments:
The root changelog file is specified as
--changelog-file.The JDBC database connection URL is specified as
--url.
The username and password are not required for connections and systems which use alternate means of authentication.