title: git revert line ending only changes
body: <p>I know this question has been asked a hundred times, but none of the answers are ever exactly satisfactory.</p>
  <p>I have a lot of tools (eg protoc protobuf compiler) which seem to one day spit out \r and the next \r\n so I can never have the files checked out the right way for every one of my developers.</p>
  <p>And after they run the code generation step every file looks dirty because line endings were invariably changed.</p>
  <p>Rather than controlling both how the file is checked in/out for line endings, and the code generators settings; I would like to be able to quickly revert every file that is a line end only change after I run my code generation script.</p>
  <p>----------------------UPDATE------------------------------</p>
  <p>I have not yet found a totally satisfactory solution, but I have found the root of my problem.</p>
  <p>My tool is generating \n but git is checking thing out in \r\n on windows.</p>
  <p>To cope with this I have set the attributes for the files as such: <code>echo &quot;*.pb.h text eol=lf&quot; &gt;&gt;.gitattributes</code></p>
  <p>Note I tracked some of this down using
  <code>git ls-files --eol</code></p>
  <p>if you continue running into the issue even after this you may want to run
  <code>git add --renormalize .</code></p>
  <p>See:
  <a href="https://stackoverflow.com/questions/14564946/git-status-shows-changed-files-but-git-diff-doesnt">&#39;git status&#39; shows changed files, but &#39;git diff&#39; doesn&#39;t</a></p>