If you have a deleted file in your current git status you can't use diff to see the content of the file.
Instead, you need to use the following syntax to show the file at a specific commit:
git show COMMIT:FILEFor example, to show the file at the current branch HEAD.
git show HEAD:some/deleted/file.txtThis shows the content of the file before it was deleted.
If you did commit the deletion change then you can either look at the file relative to the HEAD position.
git show HEAD~1:some/deleted/file.txtOr, the specific sha where the file is known to exist.
git show adb96f09aa92ba0c8b3539c281000f3e7d838a07:some/deleted/file.txtRead more about finding the relevant place in the git repo on the gitrevisions manual page.
Add new comment