Poor lad, an experience like that is bound to leave some mark, my dog has been attacked quite badly on a couple of a occasions and it has definately made him more reactive. I did hope that after he was castrated he‘d become less of a target but by that time, he‘d already learned that attack was the best defence. (I hasten to point out that his castration was for medical reasons, I wouldn‘t have had it done for any other reason and don‘t suggest it as a solution!)
One of the main things to remember is that growling, snarling, barking etc are the dog‘s way of saying „Hey, I‘m not comfortable with this, these other dogs are a threat to me and my human!“ . Rather than admonish him, try to signal to him „hey, its OK, I can take care of this“ and attempt and get him out of the situation. Try where possible to put distance between your dog and any approaching dogs, - if you‘re walking give them a wide berth (circle around rather than face head on) and put yourself between them - practice walking him on both sides of you, using heel or „right „as a command. You can try distraction e.g. with a ball on a rope or a favourite toy and then praise and reward him for NOT barking, snarling, etc. If your dog is distracted, he‘s less likely to stare at the other dog and that alone is sometimes enough to ward off the interest of the opponent.
I know its very hard but do try to stay calm and at least give your dog the impression that you‘ve got control of the situation and he doesn‘t need to be first in line to fight the foe. Try to practise a strategy before hand to deal with a situation so that you‘re prepared - I‘ve had to do that as I tend to panic and then do exactly the opposite of what I should be doing which is totally contra productive.
I have to conciously brace myself, shoulders back, head up so that I at least look as if I have it all under control and just hope that the dog‘s fooled enough to calm down
Best of looked!