git diff - How can I get content of a file from git index? -
i have file has been added local repository. i've modified in working tree, git-status shows me file modified. know file content kept in index before stage file. i can think of 2 ways of doing that: revert patch generated git-diff, , apply on file in working tree use git-checkout-index, point temporary file , read content there is there easier way? use : prefix access objects in current index (staged not yet commited). git show :file see gitrevisions more information.