0
0
Gitdevops~20 mins

Recovering from bad rebase in Git - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Rebase Recovery Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Output of git reflog after a bad rebase
You performed a rebase that caused conflicts and you want to see the previous HEAD states to recover. What will be the output of git reflog immediately after the bad rebase?
Git
git reflog
AShows only the commits that were rebased, excluding previous HEAD states
BShows only the current branch commit history without any rebase info
CShows an error: 'fatal: no reflog found' because reflog is disabled by default
DShows a list of recent HEAD changes including the rebase start and commits before rebase
Attempts:
2 left
💡 Hint
Think about what reflog tracks in Git.
🔀 Workflow
intermediate
2:00remaining
Steps to abort a bad rebase safely
You started a rebase but realize it is causing too many conflicts. Which sequence of commands correctly aborts the rebase and returns your branch to the state before the rebase?
A1, 4, 2, 3
B1, 2, 3, 4
C2, 1, 4, 3
D4, 2, 1, 3
Attempts:
2 left
💡 Hint
You need to check status before aborting and verify after abort.
Troubleshoot
advanced
1:30remaining
Recovering lost commits after a failed rebase
After a rebase gone wrong, some commits seem lost from your branch history. Which command helps you find and recover those lost commits?
Agit reflog
Bgit reset --hard HEAD~3
Cgit clean -fd
Dgit stash pop
Attempts:
2 left
💡 Hint
Think about where Git tracks all recent HEAD movements.
Best Practice
advanced
1:30remaining
Best practice to avoid losing work during rebase
Which practice best helps prevent losing commits during a complex rebase?
AUse 'git push --force' immediately after rebase
BCreate a backup branch before starting the rebase
CDelete local branches before rebasing
DRun 'git clean -fd' before rebase
Attempts:
2 left
💡 Hint
Think about how to save your current work safely before risky operations.
🧠 Conceptual
expert
1:30remaining
Understanding the effect of git rebase --continue after conflict resolution
After resolving conflicts during a rebase, what does git rebase --continue do?
AIt applies the next commit in the rebase sequence and updates HEAD
BIt aborts the entire rebase and resets to original branch state
CIt skips the current commit and moves to the next one
DIt merges the current branch into the target branch
Attempts:
2 left
💡 Hint
Think about how rebase processes commits one by one.