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 <
git checkout <
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).