I typed git reset --hard HEAD and watched hours of work vanish.
Version control gives us power, but also the power to destroy. In Git, reset is a scalpel—precise, dangerous, and worth mastering. When deadlines move fast and your MVP needs to ship, knowing exactly how to use git reset can save you from bad commits, messy merges, and wasted cycles.
What Git Reset Actually Does
git reset moves the current branch to a new commit. This changes what HEAD points to, and depending on the mode, it can also change the staging area and working directory.
- --soft keeps changes in staging.
- --mixed keeps changes in your working directory but clears staging.
- --hard wipes both staging and working directory to match the target commit.
Each mode has its purpose. Use --soft when you want to redo commits without losing changes. Use --mixed when you need a clean stage but want to keep code edits. Use --hard with caution—it deletes work.
Using Git Reset for an MVP
The MVP stage is about speed and clarity. You don’t have room for confusing branches or broken commits. With git reset, you can rewind experiments, squash noise out of history, and get back to a stable baseline in seconds.