git switch -

Category: Git - Core

git switch -

Switch back to the previous branch

Checks out the branch you were on before, like cd - for directories. It reads the previous branch from the reflog, so it works across several switches. Great for toggling between two branches during review.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.