Come back to the previous branch in git
If you change from one branch to another and you want to come back to the first one, there is a simple command in git to do it:
git checkout -
Written by Salva Revert
Related protips
2 Responses

Confirmed working as old as git version 1.7.9.5.
This rocks!
over 1 year ago
·

if you have oh my zsh:
gco -
:P
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Branch
Authors

niklongstone
42.01K

muzzlefork
11.98K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#