how to switch branches git

C++
git switch <branch_name>

git checkout <branch_name> git switch my_branch$ git checkout <existing_branch>

$ git checkout -b <new_branch>git checkout <existing branch>
Source

Also in C++: