Reset
Reset HEAD
Add an new file, and doesn’t add to stage yet, git reset HEAD
won’t change anything.
|
|
If the file was added into stage, git reset HEAD
will make the file to the Untracked
status.
|
|
For the file which has been modified, if it hasn’t been added to stage, git reset HEAD
won’t change anything. If it has been added to stage, this command will change the file to unstage
status, but the changes won’t be lost.
Reset with hard argument
--hard
argument will lead the uncommited changes lost, new files will become untracked
. BE CAREFUL!
|
|
reflog
reflog
command allows to check the commit history.
|
|
The file 3.txt
also comes back, that because it was added to the stage.
What if used reset --hard
command?