开发者

Remove all files for git commit? [duplicate]

This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Undo “git add”?

I made the mistake of running:

git add .

Which added important things such as .bashrc. Even though I run:

git rm .

When I run:

git push project master

Everything still is added. I've even reinstalled git, but I am still pestered by this. A solution I found was to start over and remove all the files from the commit. Are there any other things I开发者_如何转开发 could do to remove all the files from the commit?


You can use git reset to unstage changes, or even git reset --hard HEAD~ to blow away the most recent commit (careful with that one, it will not even keep your changes around.)

See http://git-scm.com/docs/git-reset


Use git reset.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜