How to get back to most recent version in Git?

前端 未结 10 1059

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:25

    A more elegant and simple solution is to use

    git stash
    

    It will return to the most resent local version of the branch and also save your changes in stash, so if you like to undo this action do:

    git stash apply
    

提交回复
热议问题