There's a difference between not wanting to do something again because you learned that it was mistake and regretting having done it in the first place. I've made plenty of mistakes and learned to not do that thing again, but I don't regret them. After all, had I not made those mistakes, I wouldn't know that they were, in fact, mistakes.
I think I understand what you're saying. For example, I didn't know I had a bad back until I tried to lift a heavy monitor once and it hurt a lot. Rationally, I know that I could not have known before, and it's good that I've learned. But instinctively I still get a shudder whenever I contemplate lifting something heavy, and I think that's been preventing me from hurting my back again more than any rational thought.