I don’t know if you’re joking, but in case you’re not: git reflog and git reset --hard HEAD@{n} is your friend. You can undo almost anything. Deleted commits and branches aren’t really deleted. Remotely deleted branches can be pushed again.
Except for an (accidental) git restore/git reset. Those are permanent and can’t be undone.
Even git reset can be undone by a lot of editors. At least IntelliJ has an excellent local history that works much like git. Sure it’s a pain if you touched several files but that’ll teach you to atomify your commits.
Edit: Plus, git reset itself does nothing of note really, but I’m sure you know. Needs the —hardflag to do any meaningful damage.
I don’t know if you’re joking, but in case you’re not:
git reflog
andgit reset --hard HEAD@{n}
is your friend. You can undo almost anything. Deleted commits and branches aren’t really deleted. Remotely deleted branches can be pushed again.Except for an (accidental)
git restore
/git reset
. Those are permanent and can’t be undone.Unless, you didn’t close your editor before doing so, in which case, you can just save it again.
I’m not talking about IDEs.
Even Kate gives you the option to either discard the deleted document/changes or keep them and save again.
Even
git reset
can be undone by a lot of editors. At least IntelliJ has an excellent local history that works much like git. Sure it’s a pain if you touched several files but that’ll teach you to atomify your commits.Edit: Plus,
git reset
itself does nothing of note really, but I’m sure you know. Needs the—hard
flag to do any meaningful damage.