Tower Icon

Undoing Commits

Tower offers you two different ways to undo the changes introduced by certain commits:


Reverting commits

Reverting will produce a new commit that effectively is the opposite of the commit to revert. Git will apply changes that reverse the effect of that commit's changes. In your repository's history, both commits - the original and the reverting one - will be visible.

To revert a commit

  • Select the commit (or even multiple commits) that you want to revert in the "Commits List" view.

  • Right-click the commit and select "Revert This Commit..." from the contextual menu.

  • In the following dialog, select "Automatically Commit Reverted Changes" if you want Tower to directly commit the reversing changes. If you don't select this option the changes reversing the commit will be applied to your working copy, leaving it up to you to further modify, stage, and commit them.

Roll Back to Commit

Another way to undo commits is to reset HEAD to a previous commit. Your current branch will then point at the specified older commit, effectively removing the newer commits from your history.

To roll back the current HEAD to a previous commit

  • Select the commit you want your current HEAD branch to point to.

  • Right-click the commit and select "Roll Back to This Commit... " from the contextual menu.

  • In the following dialog, you can choose how Git should treat changes:

    • If the "Keep files" checkbox is active all changes from rolled back revisions will be kept in your working directory.

    • If the "Keep files" checkbox is not active all changes from rolled back revisions will be lost and cannot be restored.

NOTE:If you have un-commited changes you want to undo see "Undoing Local Changes" for more.


Related Topics

Overview of the Commits area

Undoing local changes

Integrating individual commits via "cherry-picking"