There is a great quote doing the rounds on FB just now.
“Don’t cling to a mistake just because you spent a lot of time making it.” Unknown Source
I would like to modify the quote slightly;
“Don’t cling to a mistake just because you spent a lot of time making it. Learn from it and understand that it was an important lesson.” Amanda Martin
In other words; Understand the mistake; identify the antecedents, change the antecedent environment and try again. Trial and error is not about random learning, its about learning from every A-B-C sequence.