Putting it all Together: Reverting a Single Commit in Git

First, we locate the patch number with git log.

Then we dump it out as a patch

git format-patch -1 05bc54585b5e6bea5e87ec59420a7eb3de5c7f10 –stdout > changes.patch

(note that the -1 switch limits the number of patches…by default, git-format will pull many more.)

Once we know that we have the patches that we wish to roll back, we run this command:

git apply –reverse –reject changes.patch

Finally, we commit the reverse-changes.

The big thing is the -1 switch on git format. Many of the articles I found were pulling a large number of patches and I did not need it.