Undo multiple file and folder 'git add'
15,189
Solution 1
git reset
(which is equivalent to git reset HEAD
) will un-add
(more commonly "unstage") all files.
In Git, revert
is used for undoing an existing commit (typically a commit that happened a while ago, or has been shared with others). If your commit has not yet been shared with others, there are ways to "rewrite" recent history such that you can pretend the changes you want to revert never happened in the first place.
Solution 2
You can unstage all snapshots with git reset HEAD
or selectively unstage paths with git reset HEAD -- <filepath>
.
Related videos on Youtube
Author by
hopper
Updated on June 13, 2022Comments
-
hopper almost 2 years
I executed
git add .
and now I want to revert that git add. How can I accomplish that?
-
Mitch Wheat over 10 yearstype this into a search engine "git revert add". Voila! git-scm.com/book/en/Git-Basics-Undoing-Things
-