The <FF><FE>
is a byte order mark or BOM that marks the file as UTF-16-LE. The remainder of the file consists of UTF-16-LE characters. That is, this isn't a plain text file, it's a UTF-16 file. Git does not know how to read that (and the result is that its contents don't actually matter).
I even changed the encoding to ANSI and UTF-8 but still got the same result.
The actual bytes of the file matter: a UTF-8 file would, ideally, not begin with a BOM (UTF-8 files don't have byte order in the first place so these are just junk). The entire text of the file would then just be the UTF-8 data. This requires rewriting the file, i.e., you will need to make a new commit: the existing commit has a useless file in it.
To actually rewrite the file, you will need a tool that does it. You do not say how you changed the encoding. See UTF-16 to UTF-8 conversion (for scripting in Windows) for various options. It's possible you've already done this correctly, and made a new commit, because HEAD~1
is not the current commit, but rather some existing, previous commit. No existing commit can ever be changed, though the special name HEAD
always refers to the current commit, so as you make new commits, the commit that HEAD
means—and therefore the one that HEAD~1
means—changes over time.