Return to previous branch
Switches back to the last branch.
- Use
git checkout -
to switch back to the previous branch.
git checkout - # Examples git checkout patch-1 git checkout master git checkout - # Switches to `patch-1`
Switches back to the last branch.
git checkout -
to switch back to the previous branch.git checkout - # Examples git checkout patch-1 git checkout master git checkout - # Switches to `patch-1`
Did you make a mistake but haven't pushed your changes yet? Learn how to rewind back to a specific commit in Git.
Switches to an existing branch.
Moves local commits from the master
branch to a new branch.
Creates and switches to a new branch, optionally setting up a remote tracking branch.