Switch to a branch
Switches to an existing branch.
- Use
git checkout <branch>
to switch to the specified branch.
git checkout <branch> # Examples git checkout patch-1 # Switches to the branch named `patch-1`
Switches to an existing branch.
git checkout <branch>
to switch to the specified branch.git checkout <branch> # Examples git checkout patch-1 # Switches to the branch named `patch-1`
Did you accidentally commit to master
instead of a feature branch? Here's how you can move those commits to a new branch.
Did you make a mistake but haven't pushed your changes yet? Learn how to rewind back to a specific commit in Git.
Creates and switches to a new branch, optionally setting up a remote tracking branch.
Switches back to the last branch.