How do you undo a habit?  Choose differently, over and over.  This requires conscious attention constantly.  Spiritual awakening does not happen by itself, nor does changing thoughts and behaviors which no longer fit the growing soul.  Once awakened, place attention on what is happening with the ego.  Find yourself a reminder.  When a trigger causes a habitual response emotionally, stop yourself as the awakened spirit that you are and choose a different reaction over and over until it becomes a new habit.  While you are at it, go back and look at the root of your habitual reaction.  What was the root cause?  Pull it out gently by the root and see it dissolving.  Now you are no longer creating karma, but helping to erase it so that your true nature can shine.