swith to local branch code example Example 1: how to switch branches in git git checkout [branch name] Example 2: github go to a branch git checkout <name>