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.

Sign up to request clarification or add additional context in comments.

1 Comment

and as @Nic said in a later answer -- git reset HEAD <somefile> to unstage a specific file

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.