Git, Undoing Things
Discard staged content.
Unstage content from a specific file or folder
git reset path/to/folder
Now typing git status
you’ll see them unstaged. Need one more step back, to discard them at all
git checkout path/to/folder
You are done.
Please done that executing git checkout against a branch will checkout (switch) to that branch.
Now if you have this time files [new files] that are not part of the repository, get rid of them
git clean -fd
You can simulate it if unsure.
Now, you want to revert a wrong commit
$ git log -2
$ git revert 909989890
Where 909989890
is the commit to be reverted (undo).
This command will create a storno commit (another one that will fix the previous).