0

Add by chance all the directories of my computer with git add, I would like to discard them all, and try with git reset and checkout -. I am currently in the master branch

junior-26
  • 3
  • 3
  • Does this answer your question? [How do I undo 'git add' before commit?](https://stackoverflow.com/questions/348170/how-do-i-undo-git-add-before-commit) – phd Mar 03 '20 at 13:02
  • https://stackoverflow.com/search?q=%5Bgit%5D+undo+%22git+add%22 – phd Mar 03 '20 at 13:02

1 Answers1

0

You can use git reset file-to-discard to remove file-to-discard from "changes to be committed".

Or use git reset to remove all changes.

git checkout - will simply return you to previous branch. It's not suitable for your case.