I don't know how the streets are where you live but here the vast majority of streets have car parked alongside, parked close too. If someone got out of his car after me that wasn't far away, the only way to flee would be without my bike or by scratching the parked cars; remember I need to brake then get off the bike then pick up the bike to get from the street to the sidewalk. So I'd either loose money because the road-rager would likely take revenge on my bicycle, or me paying for the cars repairs
I think that either one of those options is FAR BETTER than engaging in some sort of medieval combat with an armed aggressor.
Personally, I'd much rather loose a bike, or get stuck with the bill for a new car paint job, then loose my life or have to chop/slash/stab someone to death.
In self-defense, running isn't always an option, and one should only use lethal force if it is absolutely necessary. But one should never put something as insignificant as the cost of a bicycle, or a cars paint, above running away from a lethal threat.
I'm sure your bicycle means a lot to you, and perhaps it would be difficult to replace it, but if you get killed because you chose to stay and fight rather than run away, you wouldn't be able to replace your life, ever. Or, if you killed or caused harm to another person with a weapon rather than run away, the cost to you in both your freedom, and money, can be more than you would ever want to imagine.
. That's of course *if* I have time to brake and get off.
It could be that I don't have time to brake and that I'm stuck with a bike between my legs, my torso between the saddle and the handlebar. It's likely that the guy wouldn't be armed but you never know!
If you don't have time to brake and get off your bike, or if you are stuck between the saddle and handlebar, I don't think you are going to be able to draw any kind or "short-sword" and effectively fight off an attacker.
My advice- seek out a qualified self-defense instructor in your area. Preferably one who is a veteran member of law enforcement. Veteran members of law enforcement who have spent a lot of time on the street will usually have a lot of experience dealing face-to-face with violent criminals and all manner of enraged citizens. A veteran member of law enforcement will also be very knowledgeable with such matters as situational awareness, the laws regarding the use of deadly force, and the laws regarding the carrying of weapons. I strongly suggest that you take this advice because it appears to me that you are very much in need of a qualified self-defense education.