When git garbage collection runs, I do believe it collects dangling commits.
Doing a "git branch backup" before doing something stupid gives you a more convenient "undo".
Alternatively, just git clone to a new directory before attempting some insane rebase operation.
So you do backups for something that already functions like a backup system. That's fascinating. Did you know that Git does not lose anything? You might find 'git reflog' useful if you happen to screw up frequently.