Key Ideas
1Git Stash — Save Work in Progress. You're deep in a feature when a critical bug report comes in — you need to switch branches immediately, but your work isn't ready to commit. git stash is your escape h...
2Interactive Rebase — Rewrite History. Interactive rebase lets you rewrite your commit history before pushing. This is how professionals keep their PRs clean: squash messy "WIP" commits into meaningful ones...
3Cherry-Pick — Apply Specific Commits. git cherry-pick copies a specific commit from anywhere in history and applies it to your current branch. It's like saying "I want exactly this change, and nothing else...
4Resetting Commits — Three Modes. git reset moves HEAD (and the branch pointer) backwards in history. The three modes control what happens to your working directory and staging area after the reset. Ch...
5Git Reflog — Your Safety Net. The reflog (reference log) records every movement of HEAD in your repository — even after resets, rebases, branch deletions, and other "destructive" operations. It's G...