title: Git: How to grep code in history and show original file?
body: <p>I'm grepping code in git history using the following command:</p>
  <pre><code>git grep &quot;foo&quot; $(git rev-list --all)
  </code></pre>
  <p>It's returning a list where each line begins with a king of hash:</p>
  <pre><code>27a7c352c1d7e5fde63f7c8857900271abc0a626:LogsController.php: $foo = &quot;Hello World!&quot;;
  c70fab1b7b7e67734839855eff34d744ec1fbcd9:LogsController.php: $foo = &quot;Hello World!&quot;;
  28a7bfb582e903af5019e2e1eaa1587a7817ec1b:LogsController.php: $foo = &quot;Hello World!&quot;;
  </code></pre>
  <p>How to view the original full file from one of these hashes ?</p>