Undoing Changes

Uncommitted changes in your local working copy can be undone easily.

Discarding Uncommitted Changes Cannot be Undone
A version control system like Git allows you to undo almost everything. However, it can only undo things that have been recorded in the local repository (by committing them). Changes that haven't been committed, yet, therefore cannot be restored.
That's why you need to be sure when you discard uncommitted local changes.

Discarding All Changes in a File

To restore the last committed state of a changed file, right-click it in the list and select Discard Local Changes.

Discarding Certain Changes in a File


To discard only certain parts of a file's changes, select it in the list to have its diff shown on the right:

  • Use the Discard Chunk button to discard a whole block of changes.
  • Use the Discard Lines button after you've selected the lines you want to discard (by clicking on their line numbers).

Discarding All Current Local Changes

To discard all current changes in your working copy, right-click the "Working Copy" item in the sidebar and select Discard All Local Changes…. This will restore your complete working copy to the state when you last committed.

Reverting a File to a Certain Revision

To restore a file back to a version from a previous commit, right-click it in the list and select Revert to Revision…. Enter the commit hash of the respective revision in the following dialog to restore the file.