Never been in such a situation myself, but I am certainly provoking it by walking at night and through a forest alone. I only got in a fight. If a sucker punch won't knock me out, then grab your legs and run. The guy who punched me in the face wished he would have done that...
Even if there's a group of people I would take them head on. But talking big is easier than done...
Depends on the situation and if you can stay calm in the right moment.
Pepper spray is a good weapon to have. Those guys expect you to grab your stuff out of a pocket and give it to them, so you can prepare your attack more easily. Just don't spray yourself.
Intel Core i7 8700K | 32 GB DDR 4 PC 3200 | ROG STRIX Z370-F Gaming | RTX 3090 FE| Crappy Monitor| HTC Vive Pro :3