0
0
Gitdevops~10 mins

git restore to discard working changes - Interactive Code Practice

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

Complete the command to discard changes in a single file named file.txt.

Git
git [1] file.txt
Drag options to blanks, or click blank then click option'
Apush
Bcommit
Crestore
Dadd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' instead of 'git restore' to discard changes.
Using 'git add' which stages changes instead of discarding them.
2fill in blank
medium

Complete the command to discard all local changes in the current directory.

Git
git [1] .
Drag options to blanks, or click blank then click option'
Arestore
Bcommit
Cstatus
Dpush
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' which saves changes instead of discarding.
Using 'git status' which only shows changes.
3fill in blank
hard

Fix the error in the command to discard changes in app.js.

Git
git [1] -- app.js
Drag options to blanks, or click blank then click option'
Aadd
Bcommit
Cpush
Drestore
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'git commit' which saves changes.
Omitting the -- which can cause errors if file names look like options.
4fill in blank
hard

Fill both blanks to discard changes in index.html.

Git
git [1] [2]
Drag options to blanks, or click blank then click option'
Arestore
Bcommit
Cindex.html
Dstyle.css
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'restore'.
Confusing file names or mixing commands.
5fill in blank
hard

Fill all three blanks to discard changes in main.py and README.md.

Git
git [1] [2] [3]
Drag options to blanks, or click blank then click option'
Arestore
Bmain.py
CREADME.md
Dconfig.yaml
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'commit' instead of 'restore'.
Forgetting to list all files.