title: GIT: Not lossing changes after branch detached HEAD
body: <p>I have been working in git submodule and I was ready to push my changes when I got this message:</p>
  
  <pre><code>$ git push
  fatal: You are not currently on a branch.
  To push the history leading to the current (detached HEAD)
  state now, use
  
      git push origin HEAD:&lt;name-of-remote-branch&gt;
  </code></pre>
  
  <p>I ran the following command thinking this may fixed:</p>
  
  <pre><code>git checkout master
  </code></pre>
  
  <p>But I got this message:</p>
  
  <pre><code>Warning: you are leaving 1 commit behind, not connected to
  any of your branches:
  
    2f1b645 my changes
  
  If you want to keep it by creating a new branch, this may be a good time
  to do so with:
  
   git branch &lt;new-branch-name&gt; 2f1b645
  
  Switched to branch 'master'
  Your branch is up-to-date with 'origin/master'.
  </code></pre>
  
  <p>My question to you guys is how can push my changes to master?</p>