A commit vanished. The branch looks wrong. You need to rewind—or undo—a moment in history without losing your grip on the code. This is where Git reset recall becomes essential.
Git’s reset command changes the current branch to point to a specific commit. Paired with a clear recall strategy, it lets you move backward, forward, or sideways through your repository’s timeline. Understanding each mode—soft, mixed, and hard—is the difference between fixing a mistake and destroying valuable work.
Soft reset moves the branch pointer to an earlier commit, but keeps all changes staged. It’s useful when you want to re-commit with updated message or squash commits.
Mixed reset moves the branch pointer, clears the index, but leaves changes in your working directory. This is the default and the safest for quick rollbacks.
Hard reset discards all changes in the index and working directory, making the branch identical to the target commit. This is absolute; there’s no undo unless you know the commit hash to restore from.