You committed the refactor AFTER the feature. Reviewers want the refactor first so the feature diff is small.
Bookmark the tip, rewind the branch, then replay the two commits in the order you want.
Medium · 6 steps · +500 XP
This scenario walks through 6 steps, in order:
Try the terminal first — you learn more by doing. When you want to check yourself, here is the command for each step.
git branch backupgit reset --hard HEAD~2git cherry-pick backupgit cherry-pick backup~1git log --onelinegit push --force-with-leaseReordering is just replaying: a branch to hold the old tip, a hard reset back to the fork point, then cherry-picks in the new order. That is exactly what moving lines in a rebase todo does.