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
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
Community Discussion
No community discussion yet for this question.