title: How to delete a commit from a deleted unmerged branch?
body: <p><a href="https://i.stack.imgur.com/A3SLc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A3SLc.png" alt="enter image description here"></a></p>
  
  <ul>
  <li>I accidentally created a branch with an incorrect name, and subsequently made a commit to it.
  
  <ul>
  <li>Lets call this: <code>commit #1</code> to <code>feature branch 'A'</code>.</li>
  </ul></li>
  <li>I copied the files included in <code>commit #1</code> to a temp folder.</li>
  <li>I deleted the <code>branch A</code> upon realising I'd incorrectly named it. </li>
  <li>I then created the branch (lets call this <code>feature branch B</code>) with the correct name and 'copy &amp; pasted' in the prior work I'd put  in the temp folder, effectively recreating <code>commit #1</code> 
  
  <ul>
  <li>Lets call this <code>commit #2</code> to <code>feature branch B</code></li>
  </ul></li>
  <li>I continued with work, completed <code>feature branch B</code>, and then released to <code>develop</code> &amp; <code>master</code>.</li>
  </ul>
  
  <p><strong>How do I delete <code>commit #1</code> and <code>feature branch A</code> completely from git history and make it look like they never happened?</strong></p>
  
  <h2>2018-04-11</h2>
  
  <p>According to the <a href="https://git-scm.com/docs/git-branch#git-branch--r" rel="nofollow noreferrer">documentation</a>, my "ghost" branch was a tracking branch.</p>