title: Screwed up the master git branch... Can't figure out what I need to revert
body: <p>I'm working on a git repository that has a branch off of master, we'll call it the <code>ab</code> branch.  My team is working on the <code>ab</code> branch and has a pull-request workflow using github.  One of my teammates made a pull request from his branch <code>jeremy_ab_deletions</code> to the <code>ab</code> branch.  I was reviewing/testing his changes, but when I went to merge them into the <code>ab</code> branch I accidentally merged them into master instead and pushed master to github before I caught my mistake. Thinking I could just git-revert the change I did <code>git revert SHA</code> and it seemed to work...</p>
  
  <p>I thought that had been enough and I happily switched back to my ab branch and continued working.  Now, however, I realize that the previous commits from the <code>ab</code> branch which should <em>never</em> end up in master, are all in master.  It's...quite the mess.  Since his branch was originally split off from <code>ab</code>, and then I merged it into master, I should have reverted it using <code>git revert -m 1 SHA</code>.</p>
  
  <p>Today I was trying to figure out where exactly I went wrong and I'm all kinds of confused based on the git history, and my reflog.  First, I tried reverting the reverts, and then doing <code>git revert -m 1 SHA</code> But git tells me:</p>
  
  <pre><code>fatal: Mainline was specified but commit 4c431c345dfe0a856967c090932c32f153824085 is not a merge.
  </code></pre>
  
  <p>So I think ok...maybe that wasn't the merge commit and I need to target a different SHA.  But looking at the history I can't for the life of me figure out which one of these was the merge commit...</p>
  
  <pre><code>This was supposed to be on AB... 
  …
  d985b5bcf8 Browse code
  Nathan B authored 8 days ago
  
  This was supposed to be on AB... 
  …
  0e01911273 Browse code
  Nathan B authored 8 days ago
  
  removed unecessary tests
  4c431c345d Browse code
  Nathan B authored 8 days ago
  Apr 17, 2012
  
  removing un-used views and pages
  a546f90ed3 Browse code
  jeremychurch authored 10 days ago
  </code></pre>
  
  <p>The two commits that say "this was supposed to be on AB" are the revert commits to revert the 'removed unecessary tests' and 'removing un-used views and pages' commits.  The next commit to master was today, and the commit before that was on the 16th, neither of which were related.  I don't see where the actual <em>merge</em> occurred.</p>
  
  <p>I went through my reflog to see where exactly everything got messed up.  I went went up and down the reflog versions using <code>git reset --hard HEAD@{NUM}</code> and then inspecting key files to see if the bad changes were in that spot yet.  Finally I narrowed it down to these reflogs:</p>
  
  <pre><code>1fe2be2 HEAD@{79}: checkout: moving from 1fe2be29c6eda9f9fc9eb0b372ee83b7c15dfc2c to jeremy_ab_deletions
  1fe2be2 HEAD@{80}: HEAD@{3}: updating HEAD
  4c431c3 HEAD@{81}: HEAD@{1}: updating HEAD
  47a97af HEAD@{82}: commit: removed unecessary tests, routes, and controller actions
  4c431c3 HEAD@{83}: merge jeremy_ab_deletions: Fast-forward
  1fe2be2 HEAD@{84}: checkout: moving from master to ab
  d985b5b HEAD@{85}: revert: This was supposed to be on AB...
  0e01911 HEAD@{86}: revert: This was supposed to be on AB...
  4c431c3 HEAD@{87}: merge jeremy_ab_deletions: Fast-forward
  c121a08 HEAD@{88}: checkout: moving from jeremy_ab_deletions to master
  4c431c3 HEAD@{89}: commit: removed unecessary tests
  a546f90 HEAD@{90}: checkout: moving from ab_page_changes to jeremy_ab_deletions
  511b340 HEAD@{91}: checkout: moving from jeremy_ab_deletions to ab_page_changes
  a546f90 HEAD@{92}: pull git@github.com:REDACTED/repo.git ab-remove-stuff: Fast-forward
  </code></pre>
  
  <p>Specifically HEAD@{88} here doesn't have the bad commits, and HEAD@{87} does.  Therefore it's reasonable to assume I screwed up at the <code>merge jeremy_ab_deletions: Fast-forward</code> commit...... but I cannot figure out which 'merge commit' that would be.  I tried this:</p>
  
  <pre><code>$ git revert -m 1 4c431c3
  fatal: Mainline was specified but commit 4c431c345dfe0a856967c090932c32f153824085 is not a merge.
  </code></pre>
  
  <p>I...can't find an actual merge commit it seems?  Does anyone have any idea what I did wrong :/  I'm all kinds of lost right now.</p>