Reverting Changes

Applies to TestComplete 14.92, last modified on September 16, 2021

There are multiple ways to revert changes or roll back to some particular state of a project or project suite.

Reverting All Local Changes

To cancel all changes that have not been committed to a repository yet:

  1. Perform any of these actions:
    • Select File > Source Control > Reset from the TestComplete main menu.
    • Right-click within the Project Explorer and choose Source Control > Reset from the context menu.
    • Click Reset on the Source Control toolbar (if the toolbar is hidden, right-click the main menu and select Source Control in the ensuing context menu to show the toolbar).
  2. In the ensuing dialog, press Yes to confirm that you want to discard all uncommitted changes.

  3. TestComplete will notify you that project files were modified and suggest reloading them. Select Yes to All to reload all project files.

Reverting Changes In Separate Files

To cancel changes in some files, do the following:

  1. Open the Commit dialog. You can do one of the following to display it:

    • Select File > Source Control > Commit from the TestComplete main menu.
    • Right-click within the Project Explorer and choose Source Control > Commit from the context menu.
    • Click Commit on the Source Control toolbar (if the toolbar is hidden, right-click the main menu and select Source Control in the ensuing context menu to show the toolbar).
  2. Select the file(s) you want to discard. Use the Ctrl or Shift keys to select multiple files simultaneously.
  3. Right-click the selected file(s) and choose Revert from the context menu.
    Reverting files via built-in Commit dialog
    Reverting files via built-in Commit dialog

    The built-in Commit dialog has two panels: Unstaged files and Staged files.

    Reverting files listed in the Unstaged files panel restores their Index state, that is, the latest staged for the commit state of that file. If the file has not been staged recently, then it is reverted to the latest committed state of that file.

    Reverting files listed in the Staged files panel restores their HEAD state. That is, the latest committed state of that file.

    Reverting files via TortoiseGit Commit dialog
    Reverting files via TortoiseGit Commit dialog
  4. TestComplete will notify you that project files were modified and suggest reloading them. Select, Yes to All to reload all project files.

If you use the TortoiseGit client, then you may call the Revert dialog to discard changes in one or more files.

  1. Open the Revert dialog. You can do one of the following to display it:

    • Select File > Source Control > Revert from the TestComplete main menu.
    • Right-click within the Project Explorer and choose Source Control > Revert from the context menu.
    • Click Revert on the Source Control toolbar.
  2. Select the file(s) you want to discard and press OK.
    Reverting files via TortoiseGit Revert dialog
    Reverting files via TortoiseGit Revert dialog
  3. TestComplete will notify you that project files were modified and suggest reloading them. Select Yes to All to reload all project files.

Rolling Back to Specific Commit

To roll back your project or project suite to the state of some particular commit:

  1. Open the Commit History dialog. You can do one of the following to display it:

    • Select File > Source Control > Show Log from the TestComplete main menu.
    • Right-click within the Project Explorer and choose Source Control > Show Log from the context menu.
    • Click Show Log on the Source Control toolbar (if the toolbar is hidden, right-click the main menu and select Source Control in the ensuing context menu to show the toolbar).
  2. In the dialog, right-click the desired commit and choose Checkout from the context menu.

    Rolling back via the TestComplete Commit History dialog

    Rolling back via the TestComplete Commit History dialog

    Click the image to enlarge it.

    Rolling back via TortoiseGit Revision Log dialog

    Rolling back via TortoiseGit Revision Log dialog

    Click the image to enlarge it.

  3. TestComplete will notify you that project files were modified and suggest reloading them. Select Yes to All to reload all project files.

Related Tasks

See Also

Integration With Git - Common Tasks
Integration With Git

Highlight search results