I've done this a few times in my career. I'm smart enough now to always backup before I make any potential mistakes and test everything on a staging server.
The worst was executing "DELETE FROM <table>" instead of "DELETE FROM <table> where userid='X' on a production server.