git checkout is not removing files that it should

后端 未结 4 710
忘了有多久
忘了有多久 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 07:57

    git stash may be the quickest way to clean up the working tree. and then git checkout -b $newbranch $commit-sha1-you-want to create a branch you are going to work with. after all your work's done, git stash pop to restore the working tree.

提交回复
热议问题