Own up to it when it happens. Can only get worse if you don't.
Hopefully you work with people that follow that as well.
I can still remember a more senior coworker copying a directory from a network share (Ctrl + C), deleting the directory, and then trying to paste it somewhere else.
I didn't speak up (he also rarely touched the mouse so flew through it), so we both got a chuckle when he realized his mistake and pinged network folks for a backup from tape.
It happens. The real world is messy. Can always learn something new. Can always do something you know not to do.