Git Switch Branch – How to Change the Branch in Git
To create a new branch in Git, you use the git checkout command and pass the -b flag with a name.
To switch to an existing branch, you can use git checkout again (without the -b flag) and pass the name of the branch you want to switch to:
This will create a new branch off of the current branch. The new branch’s history will start at the current place of the branch you “branched off of.”
Assuming you are currently on a branch called master: