I rarely get confronted. I think that having situational awareness, looking/dressing professionally and acting professionally goes a long way in deterring most negative encounters. When shooting on the Streets, these are Gary's recommendations.
Situational Awareness: Know where you are and who's around you. This takes a lot of practice. It isn't rubbernecking, as much as it is peripheral vision. You've all seen those spy movies where the good guy/gal walks into a restaurant and instantly scopes out the room ... sorta like that, as you walk check everything out, front sides and back (helps with photo opps as well), when you bring a camera to your eye keep both eyes open. If you have a bag, randomly touch your bag. If you spot/sense potential trouble, walk away (keep on walking).
Looking Professional: Dress 'professionally', like you're working for a newspaper or magazine. I always wear, from bottom to top, closed-toed shoes (no sandals), sneakers, casual shoes something comfy that you can run in. Long pant, never shorts, a shirt with sleeves and a collar, never a tank top or a Tee and never a shirt with something written on it or a crazy patterned, tie-dyed shirt. A shirt that doesn't say 'Look-at-Me-I'm-Cool', but clothing that says I'm working, respect me.
Acting Professional: Don't be goofy, if you're out on the Streets taking photos ... well that is your job for the day, take it seriously and act accordingly. No selfies, walk with determination, no stalking and hiding (unless you're into that type of thing), be out-in-the-open and upfront with your cameras. Make eye contact with people, acknowledge their presence with a quick smile or nod, be friendly, but with an undertone of seriousness, after all ... you are working.
Usually, confrontations occur in the lower economic areas of the city. Those areas often carry a opportunity for photos with greater image impact than the upscale economic areas. Be aware that those are not 'your street', you are an interloper there, and in the worst case scenario, if it is gang controlled, you are there solely at the pleasure of the gang. Always be mentally prepared for the worst. In baseball, one of the first things you learn on defense is to figure out what to do if the ball is hit to you. Before every pitch you think about the score, the outs, how the bases are loaded, the count ... and how to react if it's a fly or a grounder. Same-o for Street. Think and be prepared for the worst.
I've travelled the world and walked in some serious neighborhoods with cameras and a camera bag hanging off my shoulders. Only once has a non-government/private citizen(s) ever tried to take my cameras. Sure I've been confronted a zillion times with stink-eyes and shouts and conversations, some more polite than others. I've always been able to first, walk away from the situation before a direct confrontation (seeing/sensing a person/people watching me and closing in and I simply walk away prior to them closing in), quickly walking/running away from potential danger into an area of relative safety and/or just talking my way out.
Robbery is different from the above, people upset and insulted because they think you took their picture without 'permission', making them feel as if they're an exhibit in a zoo.
In the States, most petty robbery/theft is about drugs. The robber does know or care if your camera is a $6000 Nikon or a $300 Canon, all they care about is their next 'fix' and that camera could pay for it. Usual common sense and reason is gone as these people are mostly working off instinct. But they look for easy 'marks' ... a tourist who would be gone in a day or two, a person with their guard down. I think looking and acting professionally, a person who has made eye contact with them would not be considered an easy mark. In their mind's a pro is more likely to defend their stuff than a tourist.
This guy was huge. He is the only person who physically attempted to take my cameras. I think he was mentally challenged. I quickly walked away and he gave chase as I weaved in and out of the pedestrians on the crowded sidewalk. After about half a block of the chase, I ducked into a busy cafeteria and he didn't follow. I had a snack and continued shooting when the coast was clear.
Personally, I never carry a weapon. For me, a weapon would lower my situational awareness, embolden my reactions to confrontations and be cause for the other side to react in kind. I'd rather use my wits.