title: How to grep (search) committed code in the Git history
body: <p>I have deleted a file or some code in a file sometime in the past. Can I grep in the content (not in the commit messages)?</p>
  
  <p>A very poor solution is to grep the log:</p>
  
  <pre><code>git log -p | grep &lt;pattern&gt;
  </code></pre>
  
  <p>However, this doesn't return the commit hash straight away. I played around with <code>git grep</code> to no avail.</p>