I don’t think your friend is exacting revenge. I think she’s torn between her long-standing relationship with you and the excitement of being chosen by some of the popular kids. She’s letting herself get swept along instead of making up her own mind and taking a stand. It’s not an unusual situation. But that doesn’t make it any less painful for you.
I don’t know if the cookie friend will have the strength to stand by you when she is being courted by the new group. I do think it’s worth trying to talk to her about it – if you can do it without accusing and blaming. It’s more likely to be a successful talk if you tell her you are confused and you miss her.
Meanwhile, I encourage you to join something at school that interests you. You need to increase the pool of people you know who are interested in the same things you are. Try out for a play. Join a club. Volunteer at something that other kids volunteer for. (Many kids in my town volunteer at the local animal shelter, for instance.) Write for the school paper. It doesn’t matter what it is as long as you are genuinely interested and there are more than a few other people around your age doing it. Then jump into the activity with a smile. Don’t try too hard. Friends naturally develop out of this kind of situation. Give it time and a real effort and things will probably work out.
I wish you well.