I have a file which has been already added to my local repository. I've modified it in the working tree, so git status
shows me the file as modified. I would like to know what is the file content kept in the index before I stage the file.
I can think of two ways of doing that:
- revert a patch generated by
git diff
, and apply it on the file in the working tree
- use
git checkout-index
, point to a temporary file and read the content from there
Is there an easier way?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…