switching between branch of a repository in git code example
Example 1: canging branch in git
$ git checkout <existing_branch>
$ git checkout -b <new_branch>
Example 2: how to switch between two branches in git
git switch my_branch
$ git checkout <existing_branch>
$ git checkout -b <new_branch>
git switch my_branch