First of all accept the fact by your heart and mind that the thing is wrong. No matter how deep its root is, but accept it, with time everything changes. "Changes" in a way of advancement, growth, development and for social good. Change is not bad. Not in a day, but it will take time. Believe in yourself.
Find the original fact, research about it and why earlier you were wrong. Feel sorry. No there is nothing wrong to be yourself. Respect the fact.
Ask people who are more educated about the topic. Be genuine to learn from them. Respect them, their thoughts.
No you cannot reverse your thinking or habit. Until and unless you accept the truth by your soul and heart. There is one way, called overlapping. It worked for me in many areas. Digest the fact and overlap the new thinking or habit on the old one.
Be quite on the time or areas where that old thinking or habit triggers. You will sooner than you think change yourself.
“If you want to change the fruits, you will first have to change the
roots. If you want to change the visible, you must first change the
invisible.” ― T. Harv Eker.