title: How to recover lost commits after git submodule update and checkout?
body: <p>This is a variant on similar questions, where commits end up in a headless branch. I am adding this question to cover this particular case. In my case, the issue is the following:</p>
  
  <ul>
  <li>I did a git submodule update, which left the repository in a headless state (and I forgot to checkout again to master)</li>
  <li>I committed code, several commits in fact</li>
  <li>As I was about to push to github, I realized I was in a headless state, and switched to the <code>master</code> branch (the github app makes it soooo easy)</li>
  </ul>
  
  <p>The result: my commits were now in git limbo.</p>