Skip to content

Help us create more tutorials! Make a donation using the Donate button or become a member using the button below to hide this banner and track your progress.

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 Course > Git Undoing Things