(TIL) Git: Checkout Previous Branch

less than 1 minute read

Git makes it easy to checkout the last branch you were on.

git checkout -

This is shorthand for git checkout @{-1} which is a way of referring to the previous (or last) branch you were on. You can use this trick to easily bounce back and forth between master and a feature branch.

Via jbranchaud/til.

Tags: ,