Jonyeezs' Git Reference

Delete commit by reset

git reset --hard <commit>

Use this if you don’t want to keep that commit changes. Specify the commit as you would with soft.

Delete untracked files (by stashing)

I’m a doofus, sometimes i accidentally clean files i want. To stop making me make mistakes, instead of cleaning them, we’ll stash it (like a recycle bin!) and i can go and drop it in the future.

git stash save --keep-index --include-untracked 'recycle bin'

I recommend making this an alias. Here’s mine: git config --global alias.trash "git stash save --keep-index --include-untracked 'recycle bin'"

If you want another alias to trash any current work in the index just remove --keep-index