How to get back to most recent version in Git?

前端 未结 10 1191

I have recently moved from SVN to Git and am a bit confused about something. I needed to run the previous version of a script through a debugger, so I did git checkout <

10条回答
  •  既然无缘
    2021-01-29 18:27

    Some of the answers here assume you are on master branch before you decided to checkout an older commit. This is not always the case.

    git checkout -
    

    Will point you back to the branch you were previously on (regardless if it was master or not).

提交回复
热议问题