GIT restore last detached HEAD

前端 未结 7 1802
醉梦人生
醉梦人生 2020-12-07 12:06

Please, I have a big problem in my project: this is the scenario. I have an xcode project under GIT. Today I realized that the last commit broke some tests, so i checked out

7条回答
  •  佛祖请我去吃肉
    2020-12-07 12:43

    I tried this scenario, and find that git tell me SHA-1 of last commit:

    vors@localhost:~/git-test$ git checkout master 
    Warning: you are leaving 1 commit behind, not connected to
    any of your branches:
    
      ec600e6 333
    
    If you want to keep them by creating a new branch, this may be a good time
    to do so with:
    
     git branch new_branch_name ec600e6eb2473dd4f3732539c5c1fa5829f631b7
    
    Switched to branch 'master'
    

    Did you see this message?

提交回复
热议问题