Skip to main content
deleted 1 character in body
Source Link
prosoitos
  • 7.1k
  • 5
  • 29
  • 42

2019 update

As pointed out by others in related questions (see here, here, here, here, here, here, and here), you can now unstage a single file with:

git restore --staged <file>

and unstage all files (from the root of the repo) with  :

git restore --staged .

Notes

git restore was introduced in July 2019 and released in version 2.23.
With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), this is now what Git suggests to use to unstage file(s) (instead of git reset HEAD <file> as it used to prior to v2.23).

2019 update

As pointed out by others in related questions (see here, here, here, here, here, here, and here), you can now unstage a single file with:

git restore --staged <file>

and unstage all files (from the root of the repo) with  :

git restore --staged .

Notes

git restore was introduced in July 2019 and released in version 2.23.
With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), this is now what Git suggests to use to unstage file(s) (instead of git reset HEAD <file> as it used to prior to v2.23).

2019 update

As pointed out by others in related questions (see here, here, here, here, here, here, and here), you can now unstage a single file with:

git restore --staged <file>

and unstage all files (from the root of the repo) with:

git restore --staged .

Notes

git restore was introduced in July 2019 and released in version 2.23.
With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), this is now what Git suggests to use to unstage file(s) (instead of git reset HEAD <file> as it used to prior to v2.23).

deleted 7 characters in body
Source Link
prosoitos
  • 7.1k
  • 5
  • 29
  • 42

2019 update

As pointed out by others in related questions (see here, here, here, here, here, here, and here), you can now unstage a single file with:

git restore --staged <file>

and unstage all files (from the root of the repo) with :

git restore --staged .

Notes

git restore was introduced in July 2019 and released in version 2.23 of Git.
With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), this is now what Git suggests to use to unstage file(s) (instead of git reset HEAD <file> as it used to prior to v2.23).

2019 update

As pointed out by others in related questions (see here, here, here, here, here, here, and here), you can now unstage a single file with:

git restore --staged <file>

and unstage all files (from the root of the repo) with :

git restore --staged .

Notes

git restore was introduced in July 2019 and released in version 2.23 of Git.
With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), this is now what Git suggests to use to unstage file(s) (instead of git reset HEAD <file> as it used to prior to v2.23).

2019 update

As pointed out by others in related questions (see here, here, here, here, here, here, and here), you can now unstage a single file with:

git restore --staged <file>

and unstage all files (from the root of the repo) with :

git restore --staged .

Notes

git restore was introduced in July 2019 and released in version 2.23.
With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), this is now what Git suggests to use to unstage file(s) (instead of git reset HEAD <file> as it used to prior to v2.23).

Make answer more to the point and clearer.
Source Link
prosoitos
  • 7.1k
  • 5
  • 29
  • 42

2019 update

2019 update

As pointed out by others in related questions (see here, here, here, here, here, here, and here), you can now do thisunstage a single file with:

git restore --staged <file>

and git restore --staged <file>.unstage all files (from the root of the repo) with :

git restore --staged .

Notes

git restore was introduced in July 2019 and released in version 2.23 of Git. With
With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), Gitthis is now what Git suggests toto use git restore --staged <file> to unstage file(s) (instead of git reset HEAD <file> as it used to prior to v2.23).

So, in order to unstage one file, you can now run:

git restore --staged <file>

And to unstage all files, you can run from the root of the project:

git restore --staged .

2019 update

As pointed out by others here, here, here, here, here, here, and here, you can now do this with git restore --staged <file>.

git restore was introduced in July 2019 and released in version 2.23 of Git. With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), Git now suggests to use git restore --staged <file> to unstage (instead of git reset HEAD <file> as it used to prior to v2.23).

So, in order to unstage one file, you can now run:

git restore --staged <file>

And to unstage all files, you can run from the root of the project:

git restore --staged .

2019 update

As pointed out by others in related questions (see here, here, here, here, here, here, and here), you can now unstage a single file with:

git restore --staged <file>

and unstage all files (from the root of the repo) with :

git restore --staged .

Notes

git restore was introduced in July 2019 and released in version 2.23 of Git.
With the --staged flag, it restores the content of the index (what is asked here).

When running git status with staged uncommitted file(s), this is now what Git suggests to use to unstage file(s) (instead of git reset HEAD <file> as it used to prior to v2.23).

Minor edits to make sentences more clear.
Source Link
prosoitos
  • 7.1k
  • 5
  • 29
  • 42
Loading
added 7 characters in body
Source Link
prosoitos
  • 7.1k
  • 5
  • 29
  • 42
Loading
Source Link
prosoitos
  • 7.1k
  • 5
  • 29
  • 42
Loading