0
0
Gitdevops~10 mins

git restore --staged to unstage - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to unstage a file named example.txt.

Git
git restore --staged [1]
Drag options to blanks, or click blank then click option'
A-m
Bexample.txt
C--all
D--help
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.
2fill in blank
medium

Complete the command to unstage all files at once.

Git
git restore --staged [1]
Drag options to blanks, or click blank then click option'
A--all
Bexample.txt
C--cached
D-p
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.
3fill in blank
hard

Fix 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'
Aindex_html
Bindex.html/
C--index.html
Dindex.html
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.
4fill in blank
hard

Fill 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'
Astyle.css
Bstatus
Clog
Dcommit
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.
5fill in blank
hard

Fill 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'
Aapp.js
BREADME.md
Cstatus
Dcommit
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.