# Undo git add

Lets say you mistakenly added a file using the following command.

```
git add abc.txt
```

To undo adding run the following.&#x20;

```bash
git reset HEAD abc.txt
```

**Dont do git reset, you will loose changes**&#x20;

```bash
git reset abc.txt    < ---- DONT DO THIS
```

<https://stackoverflow.com/questions/348170/how-do-i-undo-git-add-before-commit>
