To avoid this in the future, you may want to use a transaction to give you the option to roll back.
For example
BEGIN TRAN T1;
UPDATE ImportantStuff SET ImportantValue = 1 WHERE SomeValue = 5
You can then either commit if it looks good:
COMMIT TRAN T1;
Or rollback if it doesn't
ROLLBACK TRAN T1
Of course, this is not a substitute for testing before you run a script against real data - but I have often used this during testing, rather than hoping for the best.
Without a transaction, you will need to reset the data from a back up.