title: Git Submodule has a wrong reference to its remote repository
body: <p>I have two submodules in my main repository, both linked to two another remote repositories. </p>
  
  <ul>
  <li>When I enter the 1st submodule I am getting a message "HEAD detached <strong>at</strong> xxxxxxxx" - which is fine, cause the remote repository and the submodule have the same ID (the 32 digits).</li>
  <li>When I enter the 2nd submodule I am getting a message "HEAD detached <strong>from</strong> yyyyyyyy" - which is <strong>not</strong> fine, cause the remote repository and the submodule do <strong>not</strong> have the same ID (the 32 digits). So, the 2nd submodule has a different ID than the repository it is linked to. </li>
  </ul>
  
  <p>I think I somehow manage to put my 2nd submodule on some other branch or something like that.<br>
  Long story short, I cannot even clone the main rep anymore (<code>git clone --recursive-submodules</code>) cause the 2nd submodule has a wrong ID and cannot get linked to its remote rep.<br>
  I am getting "<code>error: no ref to the remote rep</code>".</p>
  
  <p>Can someone help me?<br>
  How can I change the ID of a submodule?<br>
  Or do I need to get back my 2nd submodule on the main branch?</p>