title: Git exclude a commit in a branch
body: <p>I have a commit, I have stored in a branch, because this should go only to a specific box.</p>
  
  <p>I have merged it to the branch master, but not the branch dev, that I use locally.</p>
  
  <p>Now, by mistake I merged master to dev and that introduced this commit to dev.</p>
  
  <p>I know can git revert sha, to branch dev; but since this is going to introduce a commit that undoes that commit (I am guessing, I haven't exactly tried this), when I merge master, will this commit be undone too?</p>
  
  <p>If so, how do I undo this commit only from the branch dev. </p>
  
  <p>And oh, <code>git reset HEAD^1</code> --hard is not an option because there are other commits on master, after the un-needed commit.</p>
  
  <p>If reset back again and apply is the only option, then how do I only merge those extra commits from master other than the un-needed commit.</p>
  
  <p>Update:</p>
  
  <p>Here is the commit tree. Looks complex. I have pointed to the commit, that I don't need in the dev. (I have also removed any personally identifiable information, thanks for understanding. It is so much simpler to screenshot gitk than to ascii art.)
  <img src="https://i.imgur.com/90EBAl.png" alt="alt text"></p>
  
  <p>Thanks in advance!</p>