git diff vs git diff --staged vs git diff HEAD: What Each One Shows, Branch Diffs, .. vs ... and Exit Codes (Tested Examples)
git diff shows changes you have not staged, git diff --staged shows what you are about to commit, and git diff HEAD shows both together. Here is exactly what each one compares, with tested output from Git 2.47, plus new files, branch diffs, .. vs ... and exit codes for scripts.