title: How do I do a pristine checkout with git?
body: <p>How do I return my working directory to the state it would be in if I made a new clone and checked out the current version?</p>
  
  <p>For subversion I'd do:</p>
  
  <pre><code>$ svn status --no-ignore | awk '$1 == "?" { print $2 }' | xargs rm -r
  </code></pre>
  
  <p>and for mercurial:</p>
  
  <pre><code>$ hg status --ignored --unknown | awk  ' ( $1 == "?" ) || ( $1 == "I") { print $2 }' | xargs rm -r
  </code></pre>
  
  <p>So answers in the same line are fine. But something like <code>git checkout --clean -r b4a23</code> would be better.</p>