Git revert certain files

前端 未结 3 1164
不思量自难忘°
不思量自难忘° 2020-12-16 13:26

I want to do a revert of a commit, but only for some files. (Not a checkout; a revert. If you are unfamiliar with the difference, keep reading.)

I tried thi

3条回答
  •  暖寄归人
    2020-12-16 13:42

    A shorter sequence for when you can make a short list of what you want:

    git revert that_commit           # do the whole revert
    git reset --hard HEAD^           # in what turns out to have been a throwaway commit
    git checkout HEAD@{1} -- one/folder   # and just take what you want of the results
    

提交回复
热议问题