I accidentally spread a rumor, what should I do?

So this year I became best friends with a girl who is in a lot of my classes (She'll be H). We got along great. So one day H starts dating this guy (We'll call him D) who's always loved my other friend (We'll call her Y). H and D date for a while. Meanwhile Y's heart is breaking, she really liked D. When D breaks it off with H, he lets everyone know he really liked Y and was just messing around. H is upset because D was her first legit boyfriend & first kiss. They get back together for a few days and then break up again. Everyone is now doubly hurt.

So one day in a class I have with H and D after the breakup they keep flirting. They say they're getting back together, etc. Later when I'm talking to Y, she's telling me how mad she is at D. I'm just talking to my friend so I mention that H & D kept flirting all class. So Y confronts D about this and he flips cause I was spreading rumors. I really try not to talk about anyone and I was just talking to my friend! So the next day (last day of school before break) in the class I share with H & D, D comes to my table with my friends and bad mouths me and throws things at me all class. I leave the table go sit with my ex boyfriend who's my best friend, but I could still hear D. After that class, H doesn't talk to me and a couple other friends won't either. H confronts me later and I try to explain that I really didn't mean anything by it and was just trying to talk to my friend. H just says "well someone has to be lying" and I don't see her till after break.

When we get back, D tells everyone I know how much he hates me and those sorts of things. One day he, H, and another guy who used to be my friend follow me down the hallway talking about me and calling me things.

After a few weeks, H and I gradually start talking again. We're still distant, but whatever. One day I'm walking down the hallway with H and D starts flipping out at me. After he leaves H is like, "I'm sorry about him." She seems to be really making an effort to be my friend again. Today she even found an old note she wrote me and handed it to me. I wrote her one back and she was like "This hasn't happened for a long time". I'm hoping we're finally friends again. Does anyone know what I can do to make the situation better? What could I say? Thanks & sorry this was so long! <3
I accidentally spread a rumor, what should I do?
Post Opinion