Skip to content

Try our new Crash Courses!

Become a member using the button below to hide this banner and gain access to our new Crash Courses.

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