3 ms·
> To my knowledge, reflog won't help you get back uncommitted work that you nuked with git-reset --hard. Every version control system has a way to overwrite a
by sampo 13y ago
> To my knowledge, reflog won't help you get back uncommitted work that you nuked with git-reset --hard.
Every version control system has a way to overwrite a dirty (modified) work directory, so git is hardly any more dangerous than any other tool.
It also won't help you get back uncommitted files that you destroy with `rm`. No other tool does, either.
- jlgreco 13y agoTo be clear, I think that the behaviour of git-reset --hard is absolutely appropriate. I am just correcting the overly strong statement: "No matter if you rebase, reset --hard, or any other "destructive" operation, you can always get back to your prior state with nothing but a quick look in the reflog." There are situations that reflog won't get you back from, but those situations are perfectly logical and appropriate exceptions.
- rocky1138 13y agoYou can actually get back files that you rm. I've seen it done. Apparently it has something to do with unmounting the drive, restarting in single-user mode, then finding/knowing where it is on the drive before the OS overwrites it (hence the unmount).
- TylerE 13y agoDoesn't generally work with modern FS's that use more "clever" allocation schemes.
- willvarfar 13y agoYeah there's not a lot of tooling for it. I recall writing my own to analyse a disk image to find traces of an intrusion, so its possible if you put in the leg work even for modern complex FS that do stuff like store small files inline in inodes.
- Dylan16807 13y agoI'm not sure what you mean. The 'clever' filesystems I'm aware of are copy-on-write, which makes it much easier to recover deleted files. Unclever filesystems, like NTFS, are also quite easy to recover files on. I've had to do so multiple times.
- __david__ 13y ago> No other tool does, either. Darcs does: if you "darcs revert" to erase your local unrecorded changes you can actually "darcs unrevert" and get them back later. I guess it's a little like "git stash" but not quite, as you can only have 1 saved state and many darcs operations will nuke the unrevert save (loudly and with prompts, so it won't catch you off guard).