I have a modified file on my current working directory called file.txt
. I want to compare it with a version of it on debug branch. The following command does not work:
git diff file.txt debug:file.txt
fatal: Path 'file.txt' exists on disk, but not in 'debug'
How can I compare them? Do I have to commit first?