Had I known, I wouldn't have done it — too bad there's no regret medicine for sale.
Tips
culture
Set saying: 世上没有后悔药 (there is no regret medicine in this world). It is the everyday Chinese equivalent of 'no use crying over spilled milk' — a way of telling someone (or yourself) that you can't undo a past mistake.
register
Colloquial and figurative — never literal. Almost always appears as 没有后悔药卖/吃, framed as something that would be wonderful if it existed.