What is "git's ORIG_HEAD" reference, and when is it typically set?
Correct! Well done.
Incorrect.
The correct answer is A) ORIG_HEAD is automatically set by commands that significantly change HEAD, like "git merge", "git rebase", or "git reset", to record where HEAD pointed immediately before — a quick undo via "git reset --hard ORIG_HEAD" if something goes wrong
Correct Answer
ORIG_HEAD is automatically set by commands that significantly change HEAD, like "git merge", "git rebase", or "git reset", to record where HEAD pointed immediately before — a quick undo via "git reset --hard ORIG_HEAD" if something goes wrong
ORIG_HEAD acts as a one-step "undo" safety net for potentially history-altering operations — for example, after a problematic merge or rebase, "git reset --hard ORIG_HEAD" quickly restores the branch to its pre-operation state.