Skip to main content

Practice ยท 1 of 3

Recovery Advisor

Write advise({ pushed, othersHaveIt, hasUncommittedWork }) returning one of "revert", "reset-soft", "stash-then-reset", "recreate". Rules: pushed && othersHaveIt โ†’ "revert". !pushed && hasUncommittedWork โ†’ "stash-then-reset". !pushed โ†’ "reset-soft". pushed && !othersHaveIt && hasUncommittedWork โ†’ "stash-then-reset"; without uncommitted work โ†’ "recreate" (rebase/cherry-pick onto a fresh branch).

Difficulty: intermediate

Back to lesson: Practice: Recovery Drills โ€” Practice