--staged

A flag that points a command at the staging area instead of the working tree, as in git diff --staged or git restore --staged.

In more detail

git diff --staged compares the staging area with the last commit, showing what the next commit will contain. For git diff it is a synonym of the older --cached.

Example

git diff --staged --stat

Related terms

Taught in

References