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
Press Submit to check your solution.
Back to lesson: Practice: Recovery Drills โ Practice