Last Updated: February 25, 2016
· marcelocajueiro

git checkout - (previous branch)

If you do a lot of rebases or just switch many times between branches, this one is for you:

git checkout - will checkout the last branch you were.

# I'm in the branch foo_baz_bar
$ git checkout master
$ git pull
$ g checkout -
# and you are back in foo_baz_bar