title: Revert to last stable commit without losing newer commits
body: <p>I'm quite new to git, so I ask before making any unrecoverable mistake... :-)<br>
  In the last days I made some changes to my project to upgrade to new versions of some libs I use, but I failed (also for shortage of libs docs... :-().</p>
  
  <p>I did just resolve to abandon the upgrade, so now I need to revert to last stable commit.<br>
  I did also push to remote, but this shouldn't be a problem since I am currently the only dev on this project.</p>
  
  <p>This is my current git log:</p>
  
  <pre><code>$ git log --oneline
  22c0713 Upgrading to Firebase 1.1
  6d5f9f4 Porting customers to angularfire 0.8
  fd9db42 Porting to Angularfire 0.8
  d728b82 Working out authenticating on authenticated session problems
  d511245 Testing authWithOAuthRedirect
  abd9849 Porting to firebase 1.1.2
  8884b88 Testing loadRemote() with relative path on public repositories
  7830eea Testing loadRemote() with relative path on public repositories
  f36c2f5 Finished working on I18N
  ...
  </code></pre>
  
  <p>f36c2f5 commit (the last one I show above) is the last stable one, the one I'd like to revert to.</p>
  
  <p>I would also like to avoid loosing newer (bad) commits, for possible future reference.</p>
  
  <p>Which is the most advisable strategy for this task?</p>
  
  <p><strong>UPDATE</strong>: I'm almost there, thanks to your answers (going to accept in a minute...). Just  one more little issue: I have also a "gh-pages" branch, to push my dist subfolder to github gh-pages staging site.<br>
  Now, after</p>
  
  <pre><code>git checkout -b my_branch_for_future_reference
  git checkout master
  git reset --hard f36c2f5
  git push -f
  </code></pre>
  
  <p>doing</p>
  
  <pre><code>git subtree push --prefix dist origin gh-pages
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>git push using:  origin gh-pages
  To git@github.com:MYUSER/MYREPO.git
   ! [rejected]        3febf7c0812441c7379710d0a1f5f1ec26adbd9e -&gt; gh-pages (non-fast-forward)
  error: failed to push some refs to 'git@github.com:MYUSER/MYREPO.git'
  hint: Updates were rejected because a pushed branch tip is behind its remote
  hint: counterpart. Check out this branch and integrate the remote changes
  hint: (e.g. 'git pull ...') before pushing again.
  hint: See the 'Note about fast-forwards' in 'git push --help' for details.
  </code></pre>
  
  <p>I checked, but git subtree push has no '-f' flag... :-(</p>
  
  <p><strong>UPDATE 2</strong>: I think I found an answer to my last question myself:</p>
  
  <pre><code>git push origin `git subtree split --prefix dist master`:gh-pages --force
  </code></pre>
  
  <p>could be the solution, right? (I did not run it yet... :-).</p>
  
  <p><strong>UPDATE 3</strong>: yes, that is the solution to force push of subtree.</p>