In HEAD (final commit), I have a file called foo . In my working tree, I renamed it to bar , and also edited it.
HEAD
foo
bar
I want git diff foo in HEAD and bar in the current working tree.
git diff
Check the --find-renames on git-diff at https://www.kernel.org/pub/software/scm/git/docs/git-diff.html
--find-renames
git-diff
Or specify the paths explicitly:
git diff HEAD:full/path/to/foo full/path/to/bar
(The credit goes to twaggs from Git: how to split two different files in different branches? )
If you use the git tortoise, you can right-click the file and git a diff: Right-click on the first file and select "Diff later" in the tortoise submenu. Then in the second file you can also right-click on it, go to submenu tortoisegit and then select "Diff with yourfilenamehere.txt"
Using PhpStorm, I just copy the prev commit code and compare it with the current version using the built-in compare with clipboard tool.