You accept the fact you made a mistake, mentally pick yourself up, dust yourself down and get on with the next thing. Carrying forward what you have learned.
If you can come up with one scheme, you can come up with another. It may even be better, much better, since you’ve learned a bit now.
Perhaps you’re trying to be original. That’s never a good approach.