Indeed there are and this is no rocket science. Like Word Documents offer a change history, deleted files go to the trash first, there are undo functions, TimeMachine on MacOs, similar features on Windows, even sandbox features.
So, no, there is no undo in general. There could be under certain circumstances for certain things.
May just trash some extra files due to a fuzzy prompt, may go full psychotic and decide to self destruct while looping "I've been a bad Claude" and intentionally delete everything or the partitions to "limit the damage".
Wacky fun
[1]: https://github.com/arsenetar/send2trash (random find, not mine)