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.
State isn't always local too
Trash is a shell feature. Unless a program explicitly "moves to trash", deleting is final. Same for Word documents.
So, no, there is no undo in general. There could be under certain circumstances for certain things.