title: Github: reset to previous commit
body: <p>Small team. A colleague pushed to <code>origin:master</code> by mistake. He has reset his local repo but cannot <code>push -f</code> to Github because repo is <strong>protected</strong>.</p>
  
  <p>I have <code>fetch</code>ed the repo but not merged his errant commit into my local <code>master</code>...yet.</p>
  
  <p>How can I, assuming I can <code>push -f</code> to origin, reset <code>origin</code> on Github so that it reflects the state it was in before his mistake?</p>
  
  <pre><code>$ git push origin 2860a4c:master
  To github.com:example/myproj.git
   ! [rejected]        2860a4c -&gt; master (non-fast-forward)
  error: failed to push some refs to 'git@github.com:example/myproj.git'
  hint: Updates were rejected because the tip of your current branch is behind
  hint: its remote counterpart. Integrate the remote changes (e.g.
  hint: 'git pull ...') before pushing again.
  </code></pre>
  
  <p>Do I really need to integrate the bad commit (with <code>git pull</code>) before I can then, I assume, <code>reset hard 2860a4c</code> and then <code>push -f origin</code>?</p>
  
  <p>I just don't want to make things worse.</p>