Reverting part of a commit with git

后端 未结 6 1863
闹比i
闹比i 2020-12-22 15:21

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

6条回答
  •  暖寄归人
    2020-12-22 16:06

    Solution:

    git revert --no-commit 
    git reset -p        # every time choose 'y' if you want keep the change, otherwise choose 'n'
    git commit -m "Revert ..."
    git checkout -- .   # Don't forget to use it.
    

提交回复
热议问题