Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the command to unstage a file named example.txt.
Git
git restore --staged [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using --all unstages all files, not just one.
Using -m is for commit messages, not unstaging.
Using --help shows help, not unstaging.
✗ Incorrect
The command
git restore --staged example.txt unstages the file named example.txt from the staging area.2fill in blank
mediumComplete the command to unstage all files at once.
Git
git restore --staged [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using --cached is not valid with git restore.
Using -p is for patch mode, not unstaging all files.
Specifying a single file unstages only that file.
✗ Incorrect
Using
git restore --staged --all unstages all files currently staged for commit.3fill in blank
hardFix the error in the command to unstage a file named index.html.
Git
git restore --staged [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Adding a slash after the file name causes an error.
Using dashes before the file name is invalid.
Changing underscores changes the file name.
✗ Incorrect
The correct syntax is to provide the exact file name without extra slashes or dashes:
index.html.4fill in blank
hardFill both blanks to unstage the file style.css and show the status afterward.
Git
git restore --staged [1] && git [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using git log instead of git status does not show staged files.
Using git commit tries to commit instead of showing status.
Not specifying the file unstages nothing.
✗ Incorrect
The command unstages
style.css and then shows the current git status with git status.5fill in blank
hardFill all three blanks to unstage app.js, add README.md to staging, and then check the status.
Git
git restore --staged [1] && git add [2] && git [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up file names in the wrong commands.
Using git commit instead of git status at the end.
Forgetting to unstage or add files properly.
✗ Incorrect
This sequence unstages
app.js, stages README.md, and then shows the current status.