Git checkout <latest branch you were working on> command
Is there a command to permit checkout the last branch? Like:
git checkout --recent
git checkout --previous
The idea is when you switch branch too often you it’s easy to forget the branch you were working before the current one. Also if there’s a way to set a alias for this that would be valide.
One Solution collect form web for “Git checkout <latest branch you were working on> command”
What you’re looking for is
git checkout -
For example, say you’re on branch
foo, and there exists a branch
* foo bar
> git checkout bar foo * bar
Going back to
> git checkout - * foo bar
- “shortcut” also works for the
ls commands from within a bash terminal.