Last Updated: February 25, 2016
· akalyaev

Git - checkout previous branch easily

You probably know you can go back to the previous directory by typing the following command in your terminal: cd -.


> cd projects
> pwd
> cd -
> pwd

But, do you know git also can do actually the same when you are working with multiple branches ?

(develop) > git checkout staging
Switched to branch 'staging'
(staging) > git checkout -      
Switched to branch 'develop'