March 2025posted on 03.25.2025Checkout previous branch in Git git checkout - is a shorthand for git checkout @{-1}. It will checkout the last previous branch. @{-1} refers to the last branch that was checked. It can be used with git checkout @{-1} to checkout the previous branch. You can also checkout the N-th last branch using git checkout @{-N}. No reactions yet
Checkout previous branch in Git
git checkout -is a shorthand forgit checkout @{-1}. It will checkout the last previous branch.@{-1}refers to the last branch that was checked. It can be used withgit checkout @{-1}to checkout the previous branch.git checkout @{-N}.