Those are two different questions.
1) If you are reincarnated, I do not believe that you would retain memories or knowledge. You would come back as a new entity, but not with the wisdom of the past. (Although – books and movies tend to show the opposite – that you do come back with your previous knowledge – but I think those are plot devices and not based on fact.
But since reincarnation, ahem, doesn’t exist, there is no way to know for sure.
2) But for the purposes of this question – if it did exist, the question of “learning from your mistakes” is tangential. It’s more a matter of will than it is based on reincarnation.
Let me ask this: if there were a really bad Mafia killer – a truly bad guy who then died and was reincarnated. Would you expect him to repudiate his past life and be an upstanding citizen, or would he choose to do what he knows best, which is being a killer?
MY money is that he would go to what he knows best.