they had control of the situation and you didn't find a way to take it from them, no shame in it, it happens. As you get older these situations do get less frequent, but also, you lean more tricks to take control.
All confrontation revolves around power: who has it, who is trying to take it, and who's affraid of it.
I've been surounded many times and it doesn't bother me because I know that most of the time I'll throw the first punch and before I do I'll have singled somebody out. If you end up in a melée the trick is to acquire a 60 degree angle - it is substantially harder to defend against possible attacks when two or more people can hit you at greater angles than this. Using the 60 degree rule you can flank and counter superior numbers. So have confidence next time youre surrounded, it is no reason not to negotiate from a position of confidence.
Power is all about confidence, and the best kind is calm confidence. I'll be the first to admit that if I'm not calm I'm going to loose, I know it, even when I'm not calm. The moment you loose your calm either fear or anger gets you and you'll end up beaten up. Body language is louder than words.
Edit: and remember the best way to disarm somebody is with a smile.