exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 5 question 31 discussion

Actual exam question from Microsoft's AZ-400
Question #: 31
Topic #: 5
[All AZ-400 Questions]

HOTSPOT
-

You use Git for source control. You have an app named App1.

In the main branch, you need to restore the third most recent revision of a file named App.exe.config.

How should you complete the command? To answer, select the appropriate options in the answer area.

NOTE: Each correct selection is worth one point.

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
crymo99
Highly Voted 1 year, 9 months ago
I believe 2nd command should be: git restore --source .....
upvoted 21 times
...
zellck
Highly Voted 1 year, 5 months ago
1. checkout 2. --source https://git-scm.com/docs/git-restore#Documentation/git-restore.txt---sourcelttreegt Restore the working tree files with the content from the given tree. It is common to specify the source tree by naming a commit, branch or tag associated with it.
upvoted 12 times
...
ozbonny
Most Recent 8 months, 1 week ago
git checkout git restore --source=hash
upvoted 4 times
...
vsvaid
10 months, 2 weeks ago
git checkout main git restore --source HEAD~3
upvoted 2 times
...
ShomaV
1 year, 5 months ago
git checkout <branch> or git switch main git restore --source=HEAD~3 App.exe.config
upvoted 2 times
...
Utkarsh2020
1 year, 5 months ago
The answer should be switch and source https://git-scm.com/docs/git-restore -> see the examples
upvoted 3 times
...
FNog
1 year, 6 months ago
I'd argue that the question doesn't apply to any given option since the 3rd revision of a specific file isn't necessarily the same has the 3rd most recent commit of a branch.
upvoted 1 times
...
Rams_84zO6n
1 year, 7 months ago
git switch main git restore --source HEAD~3 ...
upvoted 3 times
Rams_84zO6n
1 year, 7 months ago
if the branch doesn't exist, checkout -b should be used. Otherwise both switch and checkout does the same thing
upvoted 2 times
...
...
darko13
1 year, 8 months ago
why not switch? both checkout and switch will do the same. weird choice.
upvoted 5 times
...
surensaluka
1 year, 8 months ago
This question came today (2023-02-14). Selected checkout | source
upvoted 8 times
...
lormar72
1 year, 9 months ago
Second answer should be --source --source=<tree> Restore the working tree files with the content from the given tree. It is common to specify the source tree by naming a commit, branch or tag associated with it.
upvoted 5 times
...
Wengatz
1 year, 9 months ago
Second answer should be --source https://www.git-tower.com/learn/git/commands/git-restore
upvoted 7 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago