我犯了一个错误,调用 git add -all,现在所有的文件都被添加。我没有做 commit和 push。我怎样才能 撤销我的行动?
git add -all
commit
push
To reset specific files you can use: git reset -- <file_a> <file_b> or to reset all your changes you can use git reset.
git reset -- <file_a> <file_b>
git reset
It has already been answered several times:
You can use git reset. This will 'unstage' all the files you've added after your last commit. If you want to unstage only some files, use git reset -- <file 1> <file 2> <file n>. Also it's possible to unstage some of the changes in files by using git reset -p.
You can use git reset. This will 'unstage' all the files you've added after your last commit.
If you want to unstage only some files, use git reset -- <file 1> <file 2> <file n>.
git reset -- <file 1> <file 2> <file n>
Also it's possible to unstage some of the changes in files by using git reset -p.
git reset -p
See