Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undo multiple file and folder 'git add' [duplicate]

Tags:

git

git-add

I executed

git add .

and now I want to revert that git add. How can I accomplish that?

like image 413
hopper Avatar asked Aug 25 '13 01:08

hopper


People also ask

Can you do git add for multiple files?

You can add all the files using the git add command like below for all the files you want to add, which will add all your files to the staging area, which means the files are ready to be committed. Now commit your files, the editions or addition made in the files will now be saved.


1 Answers

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.

like image 98
dahlbyk Avatar answered Sep 19 '22 17:09

dahlbyk