5 ms·
Warrants a big warning that using `reset --hard` will irreversibly wipe out any uncommitted changes.
by ricardobeat 10y ago
Warrants a big warning that using `reset --hard` will irreversibly wipe out any uncommitted changes.
- Flimm 10y agoAlso doing `git checkout -- filename` will lose the changes to that file permanently. The only feature I miss from Bazaar was that it would create a backup file automatically for its equivalent command. I have actually created a bash function that overrides git to add this functionality (since there is no pre-checkout Git hook and Git doesn't allow you to create an alias named "checkout").
- sleepychu 10y agoCame here for this. git undo won't restore the changes wiped out by reset --hard? They aren't stored on the reflog?
- panic 10y agoIf 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.