Here's how I handle it: It probably wasn't the best thing to do for all involved, but no one died, and it satisfied something in me that, obviously, needed attention.
If I am so self-aware and know that I would likely do it again, then I figure out exactly why it's harmful and why I shouldn't do it again. Then, I see it as a symptom and address whatever I think might be behind it, in the hopes of scratching that itch from a different angle.
I don't spend my energy on feeling guilty. I just move forward in one direction or another. Sometimes it takes that unspeakable act to shake me up to move at all, so I see it as worth the risk, though I'm thankful when it does get to remain my little secret. That way I get an important lesson without it costing me more than my own hurt feelings.
Sometimes we forget that we are still individuals with issues and unlearned lessons specific to who we are and where we come from. And where we are individually going. Every experience, we see through the eyes of others and not through our own. We don't allow ourselves to have our very own personal experiences, and that can wear on us. Then, when we finally do, we feel validated. We don't always have to share the details of the experience with others. It's okay to process them away from those who are so close to us.
However you deal with this will be a process. I don't see it being a one-and-done case, even if you never do it again. Consciously let it be a lesson for you, for whatever you think that you can learn from it. I'm still learning from experiences from yeeeaarrrrssssss ago. Just this morning on the way in, I had a moment of clarity about a years-old experience.