What is the meaning of Mend_one's_ways?

To recognise one's failings and attempt to remedy them.

Source: wiktionary.org