git checkout is not removing files that it should

后端 未结 4 717
忘了有多久
忘了有多久 2021-02-14 07:45

Using a public repo, I want to get my master branch back to a certain commit from the past. I have reviewed the options and the best thing for me looks to be a simple checkout t

4条回答
  •  执念已碎
    2021-02-14 08:09

    Git checkout will not remove files added since a previous commit. To do this I would need git revert.

    However I find git checkout thehash . a lot easier to use, and its not so hard to see which files have been added since that hash:

    git diff --name-status HEAD thehash
    

提交回复
热议问题