git,

Unstaging files in Git

Oct 15, 2022 · 1 min read · Post a comment

Unstaging files in Git is closely related to restoring deletes files in Git though. Let’s explore few possible options.

Prerequisites

  • Git

Solution(s)

Unstage a single file

git restore --staged <filename>
or
git reset -- <filename>

Unstage multiple files

git restore --staged <filename_1> <filename_2>
or
git reset -- <filename_1> <filename_2>

Unstage all files

git reset

More about Git: restore vs reset vs revert vs rebase.

Conclusion

To find more neat Git commands and hacks, simply browse the Git category. Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.

git