I was doing some work in my repository and noticed a file had local changes. I didn\'t want them anymore so I deleted the file, thinking I can just checkout a fresh copy. I
Addendum
If the branch to which you wish to return was the last checkout that you had made, you can simply use checkout @{-1}
. This will take you back to your previous checkout.
Further, you can alias this command with, for example, git global --config alias.prev
so that you just need to type git prev
to toggle back to the previous checkout.