title: git create new branch from a specific branch history and commit
body: <p><strong>I basically want to do:</strong></p>
  
  <pre><code>git checkout branchA
  git checkout -b branchB &lt;commit_id&gt;
  </code></pre>
  
  <p>which creates the new <code>branchB</code> branch from <code>&lt;commit_id&gt;</code> on <code>branchA</code>.</p>
  
  <p><strong>Question:</strong></p>
  
  <p>I'm getting into details here but the reason I'm asking is to help understand how git history works and to save a bit of typing. (the command above could of been four commands instead of two...) How do I get it to one with native git functions? Question:</p>
  
  <p><em>Is there an easier/one line way of doing the same as above?</em></p>
  
  <p>I was thinking of simply doing <code>git checkout -b branchB &lt;commit_id&gt;</code> but if I'm in <code>branchC</code> that probably won't work cause the log/history of <code>branchC</code> might not be the same as <code>branchA</code>.</p>
  
  <p><strong>Background:</strong></p>
  
  <p>My intension for this specific situation would be to quickly revert to a previous commit in case a bug was introduced to production. I however still want to keep my new code and then discard of the new branch one the old code was pushed back to the server.</p>