title: How to push new (rewritten) history to remote repository
body: <p>Basically, I have an open pull request that I want to fix and at the same time I want to make 1 commit that contains 2 features into 2 seperate commits.</p>
  
  <p>Github repository now looks like this where fix is a new branch:</p>
  
  <pre><code>master c-c-c
              \
       fix c-c-c-c
  </code></pre>
  
  <p>I created a pull request from fix.</p>
  
  <p>I wanted to change the last commit in fix into 2 commits in my local repository as follows:</p>
  
  <pre><code>master c-c-c
              \
       fix c-c-c-n-n
  </code></pre>
  
  <p>where n-n are my 2 new commits.</p>
  
  <p>To get to this point locally, I did this:</p>
  
  <pre><code>1. git rebase -i HEAD~2
  2. Changed my last commit line to "edit", saved and closed the file
  3. git reset HEAD^
  4. git stash save
  5. Removed the changes I don't want in the first commit
  6. git commit -m "commit a" -a
  7. git stash apply
  8. git commit -m "commit b"
  </code></pre>
  
  <p>So now I have 2 commits the way I want. The problem is I found a bug that ended up in the pull request. Since I have already pushed to the remote repository, it won't accept my new commits (as the original one is now missing).</p>
  
  <p>I run:</p>
  
  <pre><code>git push origin fix --dry-run
  </code></pre>
  
  <p>and I get the message:</p>
  
  <pre><code>To git@github.com:&lt;UserName&gt;/&lt;Repository&gt;.git
  ! [rejected]        fix -&gt; fix (non-fast-forward)
  error: failed to push some refs to 'git@github.com:&lt;UserName&gt;/&lt;Repository&gt;.git'
  </code></pre>
  
  <p>I have seen other posts suggest to pull my changes from origin before pushing back again, but won't that basically reset my 2 commits back into the one?</p>
  
  <p>Ideally, what I would like to do is assign the same commit ID to the last commit so it can replace the current one as is. Is there a way to do that? (Note that I didn't run <code>git reset</code> with <code>--hard</code>)</p>