

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Revert
incomplete
2: Diff
incomplete
3: Revert vs. Reset
incomplete
This lesson's interactive features are locked, please to keep using them
The git diff command shows you the differences between... stuff. Differences between commits, the working tree, etc.
I frequently use it to look at the changes I haven't staged yet. For example:
# show the changes between the working tree and the index (unstaged changes)
git diff
# show the differences between the previous commit and the current state, including the last commit and uncommitted changes
git diff HEAD~1
# show the change between two commits
git diff COMMIT_HASH_1 COMMIT_HASH_2
Diff the changes between the N and M commits. Remember, N reverted the changes from M.
Paste the full output of the diff into the textbox and submit it.