I\'m writing a Bash script, and I want to checkout a tag and then checkout back to where I started.
I tried git co HEAD@{1}, but when starting at master, th
git co HEAD@{1}
git checkout @{-1} which can be abbreviated to git checkout -.
git checkout @{-1}
git checkout -
From the manpage:
As a special case, the "@{-N}" syntax for the N-th last branch checks out the branch (instead of detaching). You may also specify - which is synonymous with "@{-1}".