From: Jonathan Nieder Date: Sat, 04 May 2013 18:48:57 GMT Subject: Re: Add porcelain command to revert a single staged file to its HEAD state while preserving its staged state Message-ID: <20130504184857.GC25863@elie.Belkin> In-Reply-To: Dimitar Bonev wrote: > @ThomasRast: 'git show HEAD:targetfile > targetfile' was proposed in > the both links that I provided in the email that your replied to, but > this introduces external dependency to the command interpreter to > output the file unmodified but not every interpreter does this. > PowerShell in particular modifies the encoding of the file That would suggest that "git show" (along with similar commands like "git diff") should learn an --output= option to avoid its output being corrupted. It doesn't leave me very happy. Is there no way to convince PowerShell to treat the output of a command as binary data with no particular encoding?