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