How do I undo a "git add" before a commit?

Asked

Viewed 39,248 times

28

I added by mistake arquivos using the command git add and I haven’t executed one yet git commit. There is a way to undo or remove these files from the commit?

1 answer

36


To undo the inclusion of an item do:

git reset <nomearquivo>

If you did git add ., can undo the inclusion of all files at once by doing:

git reset

Browser other questions tagged

You are not signed in. Login or sign up in order to post.