In such an acute danger it is not important to have a cool mind and to be able to think of all the pros and cons of a situation. The only important think is to activate the body.
Such an alarm reaction usually is time limited and will last for about 30 to 60 minutes. You might feel not perfectly o.K. after this time because there is still a stress reaction going on. But this acute stress reaction will not cause any harm to your brain. It is very unpleasant, but not at all dangerous. It is a physiological reaction, which is not very appropriate to our modern life.
Some patients have derealisation and feel very unreal if they have an anxiety attack. Again, this is unpleasant but not at all dangerous or a precursor of any brain disease.