nerdexam
MicrosoftMicrosoft

AZ-400 · Question #457

AZ-400 Question #457: Real Exam Question with Answer & Explanation

To recover a deleted branch in Git, you first use 'git checkout <COMMIT>' to navigate to the last commit that the deleted branch pointed to (found via git reflog or similar), then 'git branch features/feature11' to recreate the branch at that commit point, and finally 'git restor

Submitted by wei.xz· Mar 6, 2026Configure and manage source control - specifically recovering deleted branches using Git CLI commands within Azure DevOps/Azure Repos environments (AZ-400 DevOps Engineer Expert certification)

Question

Drag and Drop Question 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. Answer:

Explanation

To recover a deleted branch in Git, you first use 'git checkout <COMMIT>' to navigate to the last commit that the deleted branch pointed to (found via git reflog or similar), then 'git branch features/feature11' to recreate the branch at that commit point, and finally 'git restore <COMMIT>' to restore the working tree files to that state. This sequence effectively recreates the deleted branch by identifying its last known commit and re-establishing the branch reference pointing to it.

Topics

#Git branch recovery#Azure Repos#Git commands#Source control management

Community Discussion

No community discussion yet for this question.

Full AZ-400 PracticeBrowse All AZ-400 Questions