git go back to main branch code example
Example 1: how to switch to a master which is already added
git checkout master
Example 2: how to switch between two branches in git
git switch my_branch
Example 3: git change branch
git checkout <<branchName>>