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
I have used the following successfully.
First revert the full commit (puts it in index) but don't commit.
git revert -n # -n is short for --no-commit
Then interactively remove the reverted GOOD changes from the index
git reset -p # -p is short for --patch
Then commit reverse diff of the bad changes
git commit -m "Partially revert ..."
Finally the reverted GOOD changes (which have been unstaged by the reset command) are still in the working tree. They need to be cleaned up. If no other uncommitted changes are left in the working tree, this can be done by
git reset --hard