Answer the question
In order to leave comments, you need to log in
How to separately undo git add for deleted/new file?
It's strange, but I did not find a solution to such a trivial task in Google.
I have similar changes:
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: modified_file
deleted: deleted_file
Untracked files:
(use "git add <file>..." to include in what will be committed)
new_file
git reset HEAD file_name
works only for existing files, and when applied to deleted or new files, it simply does not remove them from the stage. Although when used, git reset HEAD *
all files are removed, including deleted ones with new ones.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question