title: git: detach head and force overwrite
body: <p>I normally work my way around git but this time it's bugging me! I am on a certain branch which had lets say 3 commits since its creation (i.e. <code>001</code>, <code>002</code>, <code>003</code>). So as I was on <code>003</code> I checked out to <code>002</code> and made some changes which I then commited to <code>002</code> now I want to overwrite my branch with the new commit, making it the head of the branch.</p>
  
  <p>I tried to push and I got the following <code>git push origin HEAD:&lt;name-of-remote-branch&gt;</code>. So I then tried to <code>git push origin HEAD:my-branch</code> and it got rejected (without even being sure if this is what I should be doing).</p>
  
  <p>Any ideas on how to work around it?</p>