It sounds like you got light-headed for a minute, but caught yourself before you passed out. I've felt like that in the past, usually when I get heat exhaustion, but sometimes from anxiety. It's good that you were able to relax after a while, but if you were very anxious in the beginning of the class that may have been enough to wear you out. My non-expert opinion is that you should go to class again at the next opportunity, because avoidance behavior is a huge mistake. I should know, as I've been agoraphobic for the past six years. If you avoid the class then you might start avoiding other places until your world becomes very small and it's so hard to get back out there again. Just keep reminding yourself that it wasn't the class that gave you this experience. The more you go back, the more at home you'll feel there.
P.S. If you ever get that feeling again, I found it helps to go somewhere private (like the restroom) and lie down with your feet or at least your knees raised up. It gets the blood back up to your head pretty quickly.