I want to revert a particular commit in git. Unfortunately, our organization still uses CVS as a standard, so when I commit back to CVS multiple git commits are rolled into
Personally, I prefer this version, which reuses the auto-generated commit message and gives the user the opportunity to edit and stick the word "Partially" in before finally committing.
# generate a revert commit
# note the hash printed to console on success
git revert --no-edit
# undo that commit, but not its changes to the working tree
# (reset index to commit-before-last; that is, one graph entry up from HEAD)
git reset HEAD~1
# interactively add reversions
git add -p
# commit with pre-filled message
git commit -c
# reset the rest of the current directory's working tree to match git
# this will reapply the excluded parts of the reversion to the working tree
# you may need to change the paths to be checked out
# be careful not to accidentally overwrite unsaved work
git checkout -- .