Hacker News new | ask | show | jobs
by sleepychu 3589 days ago
Came here for this. git undo won't restore the changes wiped out by reset --hard? They aren't stored on the reflog?
1 comments

If it hasn't been committed, it won't be in the reflog. Working copies and stashed changes are especially vulnerable to being overwritten by accident. It would be great if git had a way to undo these operations too.
You could alias reset to instead commit all and then reset.
But what if I'm just trying to unstage something? I don't think shell aliases can solve this in the general case.