Ad space (banner)
🌿Git Lessons
Lesson 16 / 59

Unstaging with git reset

This lesson covers undoing staged changes with git reset. It's for anyone searching "git reset usage."

git reset is a command for undoing a change you've staged, or even a commit itself. Use it in a moment like "oops, I added too much."

In Try It, run git reset. The files that were staged fall back out of staging, while the changes themselves stay right there in your working directory.

A common early mistake is underestimating the danger of git reset --hard — that option actually deletes the changes themselves, so using it carelessly can lose real work. In real teams, reset is one of the basic commands used day to day, such as when re-selecting which files to include in a final check right before committing.

Git
Try it (type this into the pseudo terminal)
git reset

🧑‍💻 You can type this command into the Git pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)