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
Font: http://stackoverflow.com/questions/7206801/is-there-any-way-to-git-checkout-previous-branch
Written by Marcelo G. Cajueiro
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Tips
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#