If your life is in danger and there is no other option but to physically defend yourself, then you should do so.
There is a prayer given in the works of Samael Aun Weor to be used in dangerous situations:
Against Danger from Bullets, Knives, Wounds, Enemies, Ambush, etc.
Are you in a dangerous situation? If so, filled with faith, recite the following words:
Fons Alpha Et Omega, Figa, Figalis Sabbaoth, Emmanuel, Adonay, O, Neray, Ela, Ihe, Reutone, Neger, Sahe, Pangeton, Commen, Agla, Matheus, Marcus, Lucas, Johannes, Titulus Triunphalis, Jesus Nazarenus Rex Iudaeorum, Ecce Dominicae Crucis Signum Fugite Partes Adversae, Vicit Leo De Tribu Judae, Radix David Alelluyah, Kyrie Eleison, Christe Eleison, Pater Noster, Ave Maria, Et Ne Vos, Et Venia Super Nos Salutare Tuum, Oremus.
(You must know all of these magical words by memory and you must pray them with faith in the moments of grave danger. Thus, you will save yourself from knives, bullets, secret enemies, ambush, etc., etc., etc.).
This prayer can actually be used anytime you feel the need for protection, not just if in a dangerous situation.