Challenge 1
Complete the Git command to restore file or index state.
git --staged
Press Ctrl⌘Enter to check your answer
Create a disposable repository with one committed file. Make one edit and stage it, then make a second working-tree edit. Use `git diff --cached` and `git diff` to observe the two states. Use `git restore --staged` to remove the first change from the index without discarding the working-tree content. Then use `git restore` to make the working tree match the index. Finally, verify that `HEAD` and the branch tip never changed during the restore operations. Success means you can identify which local state each command changed, explain the source used by default, and demonstrate that no commit was rewritten or created.
Challenge 1
git --staged
Press Ctrl⌘Enter to check your answer
Challenge 2
git
Press Ctrl⌘Enter to check your answer
Challenge 3
git --staged -- file.txt
Press Ctrl⌘Enter to check your answer
Challenge 4
git -- file.txt
Press Ctrl⌘Enter to check your answer