Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Podia.

Unstage files – Git

Summary

To unstage a single file in Git, enter the following command in your terminal:

git reset HEAD file-name

To unstage all of the files that are currently staged, enter the following command in your terminal:

git reset

Exercises

First, add some code to index.html. Then stage the changes using git add .. Then unstage them using git reset.

References

Undoing Things from the Pro Git book

git-reset from the Git documentation

Back to: Git Reference > Git Undoing Things