heartbreak..please help!:(

hello everyone..so basically, I met a guy a couple of weeks ago, and super super fell for him..we hit it off, and although I haven't slept with him, I have been intimate with him, and I've told him I like him etc.. we went to a music festival together, along with some of my friends. I found out, on the third night of the festival (after I'd spent the previous two tucked up all cosy in a tent with him), that he had hooked up with my BEST female friend. He knew we were best friends, and I knew they were friends too (through me) but I never thought either of them would do something like that to hurt me. Advice on how to handle forgiving them both, how to regain my relationship with my best friend, and how to get over him... I'm struggling with the last thing most, I can't stop thinking about him! Thank you so much, I'd appreciate any tips!!xxx