Accidental commits to master - how to fix it
<p>In the project we have a main repo with master branch <code>MAINREPO/master</code> (upstream). My team has a fork <code>MYTEAM</code> (origin). We aggried that we use <code>MYTEAM/master</code>only synchronize with <code>MAINREPO/master</code>:</p>

<pre><code>1. git checkout master 
2. git fetch upstream 
3. git rebase upstream/master 
4. git push
</code></pre>

<p>But of course, somebody broke this rule and accidentally commited to <code>MYTEAM/master</code> (origin/master). And now, <code>4. git push</code> fails. My first idea was to use <code>git push origin master -f</code> but it seems that my remote forbids that:</p>

<blockquote>
  <p>remote: error: GH003: Sorry, force-pushing to master is not allowed. !
  [remote rejected] master -> master (pre-receive hook declined)</p>
</blockquote>

<p>I'm not and admin of my enterprise github so I guess I can do nothing about it? Anyway, how can I fix my origin master?</p>