The following worked for me (using only branch master): git push origin HEAD:master. git checkout master. git pull. The first one pushes the detached HEAD to remote origin. The second one moves to branch master. The third one recovers the HEAD that becomes attached to branch master. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.