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 make a mistake but haven't pushed your changes yet? Learn how to rewind back to a specific commit in Git.
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.
Switches back to the last branch.