Interactive rebase last N commits
Squash, reorder, or edit the last 5 commits
git rebase -i HEAD~5
More git commands
-
git cherry-pick <sha>Apply a single commit from another branch
-
git reflog show --date=relative | head -20Show recent HEAD movements including rebases and resets
-
git stash push -m 'WIP: feature-x' -uSave uncommitted work (including untracked files) with a label
-
git stash pop stash@{2}Apply and drop a specific stash entry
-
git bisect start && git bisect bad HEAD && git bisect good <good-sha>Binary search through history to find a regression