1

Is it possible to open the original version (HEAD) of a file in git that's been overwritten in the working directory, without resetting the changes? This would be incredibly useful for viewing before and after binary files (like images), where git does not give useful output.

Ideally, it would be possible to open both versions (perhaps the index too), at the same time, so they could be viewed side-by-side.

naught101
  • 18,687
  • 19
  • 90
  • 138

1 Answers1

1

You could at least copy that binary elsewhere, in order to be able to open it:

 git show HEAD:yourBinaryfile > /elsewhere

See "In Git: view a file in a different branch without changing branches" for more on git show.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250