35

Possible Duplicate:
Undo git add before commit

When i was working on my project I accidently added files using the following command

git add file

I haven't yet run

git commit.

How can I undo or remove these newly added files from the commit?

Please help.

0

1 Answer 1

47

git reset is a literally "undo" of git add - it removes the changes from staged area.

1
  • 5
    and as @Nic said in a later answer -- git reset HEAD <somefile> to unstage a specific file
    – drzaus
    Commented Jul 19, 2013 at 14:18

Not the answer you're looking for? Browse other questions tagged or ask your own question.