title: Remove remote commit in git
body: <p>I can't find working solution for my problem:</p>
  
  <p>How to remove commit in local and also in remote repository.
  Here is one <a href="https://stackoverflow.com/questions/4647301/rolling-back-local-and-remote-git-repository-by-1-commit#">solution</a>. But when I try this I can go back with <code>reset</code> command in my local repository. But I can't push it. The error message says:
  <code>remote: error: denying non-fast-forward refs/heads/master (you should pull first)</code>
  But after <code>pull</code> my master points again to the commit that I want to remove.</p>
  
  <p>Can you help?</p>
  
  <p>EDIT - my try:</p>
  
  <pre><code>$ git reset --hard HEAD^1
  HEAD is now at 1c50f9c good commit
  
  $ git push -f
  Total 0 (delta 0), reused 0 (delta 0)
  remote: error: denying non-fast-forward refs/heads/master (you should pull first)
  To E:/reps/gf.git
   ! [remote rejected] master -&gt; master (non-fast-forward)
  error: failed to push some refs to 'E:/reps/gf.git'
  </code></pre>