NM

It is not a mess that cannot be cleaned up.
You have taken a major step you have not only recognized something that you have done in the past that was not the best choice you have also recognized why.
Seems to me that makes the fixing it easier. The first step I think would be to talk to your SO explain to him you realize this and also explain why you believe that you reacted as you did and that in the future you plan on being more supportive as best as you can under the circumstances.