Undo changes

You can use the Undo operation in Source Control Manager in dbForge Studio for SQL Server to revert uncommitted changes made to database objects or static data in a database linked to a source control repository.

Warning

The Undo operation makes permanent changes to the linked database. These changes cannot be recovered unless you restore the database from a backup created before the operation.

Note

To avoid data loss, ensure static data is linked to source control before reverting changes or updating the database with the latest version from the repository.

Roll back uncommitted changes

1. In the Local changes section, select the checkboxes next to the objects or static data you want to undo.

2. Click Undo.

Tip

To undo all changes, select the checkbox next to Local changes.

Undoing changes

3. In the confirmation dialog, click Yes to confirm the Undo operation.

Confirming the Undo operation

The Undo window appears and shows the progress of the operation.

4. To close the window, click OK.

Undo window with results

Undo changes in dependent objects

If you select an object that depends on other uncommitted objects or changes, a prompt appears suggesting that related items also be included in the Undo operation.

For example, if you add a table and a view that selects from it, and you choose to undo changes for the view only, dbForge Studio will prompt you to include the related table.

Dependencies window

To proceed, click Continue.

You can exclude related objects from the operation if needed.

Undo operation behavior

When you run the Undo operation, dbForge Studio generates a deployment script that updates the linked database. The script may include:

  • CREATE, ALTER, or DROP statements for schema changes.
  • INSERT, UPDATE, or DELETE statements for static data changes.
  • Object statuses (Add, Modify, or Remove) as displayed in Source Control Manager.

Limitations of the Undo operation

You cannot undo the following database changes:

  • Committed changes – Once committed, changes must be reverted manually or by restoring a previous version.
  • Static data changes – Data edits or links cannot be undone. For instructions on how to unlink specific tables, see Link and unlink static data.
  • Dropped data – Dropped columns or tables cannot be restored using Undo.
  • NOT NULL columns – Dropped NOT NULL columns containing data cannot be restored unless they have default values.