First, while your instinct might be to run away as fast as your legs will carry you, your best bet is to wait. Try to discover the reason for the attack. Are you in between a mother and her baby? Are you simply too close to the baby? Have you somehow boxed the deer in? These are important things to know. Deer are naturally prey. Their eyes are positioned on the side of their head, whereas yours face forward, like a predator. The only reason that prey will attack a predator is for protection. It will do you no good to run, if you have not first identified the nature of the offense you are pursuing that enrages the deer. Doing so leaves you running the chance that you will run towards trouble rather than away from it.
Upon discovering the nature of the reason for the attack, step slowly away from the offensive location. Keep the deer in front of you. Walk away slowly. Don’t run. Make sure to maintain eye contact with the deer at all times. If you run, the deer may charge. A better plan is to keep the deer frightened of you by staring straight into its eyes as you inch away from your position.
As you move away from the offense area, yell and scream and flail your arms as much as possible. The more you frighten the deer, the more likely it is to run away. If the animal does not leave you alone, then something about your is still offending the deer’s territory. Start over and figure it out if you can, what has irritated the deer. With deer, as with people, when you understand the cause effect for a certain action, the inclination after subsiding of offense is for the deer to change gears, and to stop attacking.