Skip to content

Instantly share code, notes, and snippets.

@sadeeshr
Created January 25, 2018 04:21
Show Gist options
  • Save sadeeshr/8041e6f6154c3689ba179469cb346382 to your computer and use it in GitHub Desktop.
Save sadeeshr/8041e6f6154c3689ba179469cb346382 to your computer and use it in GitHub Desktop.
git fix detached HEAD back to master
inside your detached HEAD branch...
git commit -m "updated code changes"
git branch detached-head-jan25-branch
git checkout master
git merge detached-head-jan25-branch
resolve conflicts if any ...
git add <conflict files>
git commit -m "merged detached HEAD with master"
git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment