There’s an “undo” action on the context menu for files and folders.
assitant
Which action are you referring to?  Selecting a file, moving files, etc?
assistant
How do you undo an action in file explorer?
user