Introduction
Sometimes you want to see what changes you have prepared to save before actually saving them. The command git diff --staged shows the differences between the last saved version and what you have marked to save next.
When you want to review the exact changes you have marked to save before making the save permanent.
When you accidentally staged some files and want to check what changes are included.
When you want to compare your staged changes with the last saved version to ensure correctness.
When you are preparing a save and want to double-check what will be included.
When you want to see the difference between your staged files and the last commit.