title: How to recover commit from 'detached head state'?
body: <p>I checked out another branch with updates then made a few changes, switched back to the main git and now the changes disappeared! Can I get them back? the terminal was basically:</p>
  
  <pre><code>$ git commit
  [detached HEAD 7c09e17] Fixed some stuff
    files changed, insertions(+), deletions(-)
  $ git push master
  fatal: 'master' does not appear to be a git repository
  fatal: The remote end hung up unexpectedly
  $ git checkout master
  Previous HEAD position was 7c09e17... Fixed some stuff
  Switched to branch 'master'
  $ git merge theother/directory
  </code></pre>