Categories
Git

Undo ‘git add’ safely ?

You can undo git add before commit with

git reset <file>
or
git reset <directory>

It will not delete any of your files

.gitignore could be useful before executing git add *

  • Step 1
touch .gitignore
  • Step 2
.DS_Store
/vendor

Leave a Reply