exam questions

Exam AZ-400 All Questions

View all questions & answers for the AZ-400 exam

Exam AZ-400 topic 5 question 37 discussion

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

DRAG DROP
-

You have an Azure Repos repository named repo1.

You delete a branch named features/feature11.

You need to recover the deleted branch.

Which three commands should you run in sequence? To answer, move the appropriate commands from the list of commands to the answer area and arrange them in the correct order.

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
shivani131995
Highly Voted 1 year, 11 months ago
It should be: git log git checkout <SHA1> git branch features/feature11
upvoted 32 times
peekingpicker
1 year, 8 months ago
$ git branch features/feature11 fatal: a branch named 'features/feature11' already exists
upvoted 1 times
resonant
1 year, 8 months ago
The error message means you didn't delete the branch to begin with
upvoted 3 times
...
...
Tyler2023
1 year, 8 months ago
This is correct I tried this locally
upvoted 1 times
...
...
MrAZ105
Most Recent 6 months, 1 week ago
git log Use this to find the commit hash (<SHA1>) of the deleted branch. git checkout <SHA1> Check out the commit where the deleted branch last pointed. git branch features/feature11 Create a new branch at that commit to recover the deleted branch.
upvoted 4 times
...
Mattt
11 months, 3 weeks ago
- git log : to find the related hash - git checkout [hash] : to navigate to the hash - git branch features/feature11: to create a new branch from current point
upvoted 3 times
...
ozbonny
1 year, 2 months ago
git log git checkout [hash] git branch feature/f1
upvoted 1 times
...
hanzocodes
1 year, 4 months ago
Log Checkout that Branch
upvoted 1 times
...
vsvaid
1 year, 4 months ago
git log -for getting commit id git branch features/feature11 commitId -- create new branch pointing to commit git checkout features/feature11 -- checkout
upvoted 2 times
...
gabo
1 year, 7 months ago
git log git checkout git branch
upvoted 1 times
...
isawitfirst
1 year, 7 months ago
should be: git log: This command lets you see the commit history. Look through it to find the last commit SHA of the deleted branch features11. Let's assume the SHA you found is <SHA1>. git branch features/features11 <SHA1>: This command creates a new branch named features/features11 pointing to the commit <SHA1>, which was the tip of the deleted branch. git checkout features/features11: This command switches to the recovered branch.
upvoted 3 times
...
flafernan
1 year, 9 months ago
Here are the three commands you must run in sequence to recover the deleted branch: 1. git log (to get the SHA-1 of the latest commit from the features/feature11 branch) 2. git branch features/feature11 <SHA1> (recreate the features/feature11 branch at the same point where it was deleted) 3. git checkout features/feature11 (switch to retrieved branch) This will restore the features/feature11 branch to its pre-deletion state. Be sure to replace <SHA1> with the correct SHA-1 value obtained in the first step.
upvoted 2 times
...
halfway
1 year, 9 months ago
The answers are so weird. To restore a branch, I would: 1. git log -> to get the SHA which was HEAD of the deleted branch 2. git checkout <SHA1> 3. git checkout -b feature/feature1 Any combination of the given answers won't work
upvoted 3 times
...
kay000001
1 year, 11 months ago
Should be: git log git branch features/feature11 git checkout features/feature11
upvoted 4 times
[Removed]
1 year, 11 months ago
git checkout <SHA1>
upvoted 1 times
kay000001
1 year, 11 months ago
Apologies, you are correct.
upvoted 1 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