title: Selectively revert or checkout changes to a file in Git?
body: <p>Is there a command that allows you to partially undo the changes to a file (or files) in the working directory?</p>
  
  <p>Suppose you have edited a file a lot but you realize that you want to undo some of the changes back to the committed state, but not the other changes.</p>
  
  <p>I'm envisioning an option for <code>git checkout</code> that works a lot like <code>git add -p</code>, i.e. it goes through the file hunk by hunk and asks if you want to keep it or not.</p>