Sadly it seems like that it's not possible to retrieve the original version of an "autocrlf
ed" file, as long as there is no untouched version of the file in the history (means no autocrlf
used).
With core.autocrlf
true
git replaces all occurences of the windows line ending (\r\n
) with the unix style line ending (\n
). After that it's not possible to determine which \n
bytes used to be encoded as \r\n
bytes.
Therefore I'm obliged to conclude that it's impossible to restore the file.
This is a reason to avoid autocrlf
and to handle line endings yourself. In general I recommend to avoid autocrlf
; more information on this topic can be found here.