, git rm --staged <file>
git reset HEAD <file>
, .
git rm --staged
, , . git add
.
git reset
, , . git add
.
, .
git rm --staged some-file
. . git rm --staged
. git add
. , , , . . , .
From the git reset HEAD some-file
changes made to the file since the last commit will be deleted from the staging area, but the file is still being tracked. Therefore, when you return to commit where you started git reset HEAD some-file.txt
, the file will still be there, but there will be no changes.
To disorder the file should be used git reset HEAD <file>
.
source
share