(for e.g., on the wrong branch): Suppose you have commits: 5, 4, 3, 2, 1, and you want to revert your changes back to the commit 2. Then, you can do: $ git revert 5 4 3 This will generate 3 commits, reverting the changes from the commits 5, 4 and 3, in this order. It will prompt you for a commit message for each one. Doing it that way is nice because it preserves the repository history and is not a destructive change. :)