A handgun is used to not to "fight your way to your rifle" but to fight your way the heck out of there by any means necessary as fast as possible.
Keep your eyes and ears open. Not in a Rambo "Condition Red" way just situational awareness. Pay attention to what is going on around you. Large gangs of thugs, riots etc rarely come out of no-where. If you see signs of something like that, run the opposite direction as fast as possible. Avoid area's where miscreants congregate.
As for a firearm, revolver or pistol is a personnel choice. My wife and I carry both depending.