Languages
[Edit]
EN

Git remove added directory before git commit - revert git add -A

4 points
Created by:
sienko
743

In this article we would like to show how to undo directory added with 'git add -A' command.

Quick solution:

Practical example. Remove entire intellij IDEA settings added to git changes by mistake:

Entire practical example - step by step:

1. git add -A

We add all of our files to git repo (coding ASAP).

2. git status

We see that we have unwanted changes directory .idea/

3. git reset .idea/

We remove entire .idea/ directory from git changes.

4. git status

Now, we see, we don't have .idea/ direcotry in git changes. We can commit our changes.

 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Git

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join