To push the history leading to the current (detached HEAD) code example
Example: after checkout fatal: You are not currently on a branch.
git branch temp-branch
git checkout master
git merge temp-branch
git push origin master
git branch temp-branch
git checkout master
git merge temp-branch
git push origin master