Review changes and staging with diff
Review exact working-tree and staged changes before committing.
- Difficulty
- beginner
- Time
- 35 minutes
- Last verified
- 9/21/2026
What you will build
Review exact working-tree and staged changes before committing.
Understand the idea first
Review exact working-tree and staged changes before committing.
Build it step by step
git diff
git add css/style.css
git diff --staged
git restore --staged css/style.css- Open the previous project and record its result.
- Type the example and complete: Change two files, stage one, and prove staged diff contains only intended work.
- Change one input, predict, then verify.
- Create and repair: Git add is not save; read diffs before and after staging.
Read the important lines
- Review exact working-tree and staged changes before committing.
- Read input, processing, and output separately.
- Verify another input and an edge case.
Common mistakes and what to check
| Symptom | What to check |
|---|---|
| Unexpected result | Git add is not save; read diffs before and after staging. |
| Nothing changes | Save, verify paths, and read the first relevant Console error. |
Practice without copying
Change two files, stage one, and prove staged diff contains only intended work.
Check the answer after you try
Rebuild and explain the decisions. Check: Git add is not save; read diffs before and after staging.
Completion check
- I produced the required visible result
- I can explain the input, processing, and output
- I tested normal, edge, and failure cases