Answer the question
In order to leave comments, you need to log in
Removing commited files in git?
Hello! Please tell me how to remove the committed (git add) changes and return to the previous ones. I'll explain the situation... I just committed the changes with the command (git add . ) This allows you to not only commit changes to files, but also adds new ones. So, by accident I added a folder with files (node_modules)
So I want to remove this commit and revert back to the previous one. And one more thing ... Is it possible to somehow put the folder in git ignore in order to avoid accidental addition in the future. Thank you!
Answer the question
In order to leave comments, you need to log in
Is there any way to put the folder in git ignore to avoid accidental adding in the future. Thank you!You can, create a .gitignore file in the root and write something like the following there (my .gitignore file):
.idea/
nbproject/
node_modules/
css/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question