title: Git - Make local HEAD the new master
body: <p>I decided to go back a few commits because the path I followed was wrong. So I checked out <code>Added cordova to .gitignore</code> commit, and made some modifications. Like illustrated below :  </p>
  
  <p><img src="https://i.stack.imgur.com/WXoVh.png" alt="enter image description here"></p>
  
  <p>Now when I <strong>push</strong> the new modifications, an error message shows up :<br>
  <code>error: src refspec (detached from aad6423) does not match any.</code>  </p>
  
  <p>How can I tell git to discard the previous commits (in purple) and continue with my local HEAD as master ?</p>