Quick switch to the previous branch
ℹ️ Use "git checkout -" to switch to the previous branch

Description

To move back to the branch you were on previously you can use:
1
git checkout @{-1}
2
# or
3
git checkout - # equivalent to @{-1}
Copied!
You can use the @{-N} syntax to refer to the N-th last branch/commit checked out using "git checkout" operation. You may also specify - which is synonymous to @{-1}.

Read More

Copy link