git checkout is not removing files that it should

后端 未结 4 2051
迷失自我
迷失自我 2021-02-14 07:27

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 07:53

    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
    

提交回复
热议问题