Sometimes you want to revert an old commit (for example, a PR to master), but keep some of the changes. If you just revert with git, it will create the new commit with the opposite of the changes from the commit you are reverting.

So if you do a git reset HEAD~ at this point, you will see all the changes and can make sure you keep some of them.

Perhaps trivial to some, but a very useful trick nonetheless.

--

--