title: What is the correct way to merge upstream without losing changes?
body: <p>I'm in a bit of a pickle.</p>
  
  <p>I started development on a fork of a repo a few months ago.  I made some changes.  I was about to push my code back to the master as a pull request, but I realized there were quite a few changes in the meantime...</p>
  
  <p>So, <a href="https://help.github.com/articles/fork-a-repo" rel="noreferrer">following the instructions at Github</a> under "Pull in Upstream Changes" I tried:</p>
  
  <pre><code>$ git remote add upstream ...  # savon/httpi
  $ git fetch upstream
  $ git merge upstream/master
  $ git push origin/master       # coldnebo/httpi
  </code></pre>
  
  <p>However, now my fork is rather messy.  I'm still rather a novice with git, so instead of trying to guess what the terminology is I'll simply show you what I got and what I expected:</p>
  
  <ul>
  <li>wanted this: (Showing 7 changed files with 112 additions and 5 deletions.)
  <a href="https://github.com/savonrb/httpi/pull/59/files" rel="noreferrer">https://github.com/savonrb/httpi/pull/59/files</a></li>
  </ul>
  
  <p>This is the diff I want.  Is there any way to rebase/revert and do this without losing my changes?</p>
  
  <ul>
  <li>got this: (324 commits covering nearly the entire project plus 4 new branches... OUCH!!)
  <a href="https://github.com/coldnebo/httpi/commits/master" rel="noreferrer">https://github.com/coldnebo/httpi/commits/master</a></li>
  </ul>
  
  <p>what a mess.</p>
  
  <p>maybe <code>git pull</code> would have been better?</p>
  
  <p>It's not many changes, so if it's unrecoverable I can always manually diff and remaster it, but I'm looking for the "right way" to do this in the future.</p>