git head detached at code example Example 1: head detached at origin/master git checkout master Example 2: git return from detached head git checkout <branchname>