There's probably not a one of us who hasn't done something we've regretted during our lifetime. I even saw a call for contest submissions with this theme. I bet they get plenty of entries. We're humans so we make mistakes on occasion. We rue them, we sometimes agonize over them, we beat ourselves up--figuratively-and we pledge never to do that again.
That last part is key here. If you promise yourself to never repeat the error, it means you learned something. We need to sit down when we're rationale and ask ourselves what we learned. If you can come up with an answer, then whatever happened was not a mistake. You ended up with a benefit from whatever mistake you may have made.
For illustration's sake, let's say that a newbie writer finishes a story that she thinks is just grand. She has a market in mind and is so excited, she copies and pastes the story into an email and clicks Send. She can hardly wait until the editor contacts her with the good news. The problem is that the editor either does not contact her or he/she sends a form rejection letter. Disappointing to the writer for sure. When that first rejection comes along, it brings dejection, anger and even hurt. If the writer is to learn something from what happened, she needs to wait until she's calmed down and then read the story over again, ask herself why the editor may have rejected it.
There are any number of reasons, but often newbie writers mess up on the little things. They don't make sure the story is free of spelling and grammar errors. They don't pay attention to format--things like separating paragraphs with a space between for single-spaced stories or by indenting each paragraph for double-spaced documents. Maybe she needs to go back and read that market's guidelines for submission, check carefully to see that she followed them. It could be that she used language that was too flowery, a common error when we begin to write. It could be that the story pattern doesn't flow well or it's too long and rambling.
Whatever she finds wrong will be a lesson learned. Of course, it's possible that the rejection came only because the editor had no place for the story or had recently published something very similar. That happens, but we writers also make mistakes in our writing. Not a problem if we learn from those inadvertent errors and move on. No regrets!