Job No. 1 is to deter an attack by showing the lion you're boss: Stand tall, wave your arms, etc. If that doesn't work, fight back with whatever you've got: hands, rocks and, should local laws allow it, firearms.
Read the ears. If they're fanned out, the elephant's probably bluffing. If they're back, "Be worried." Because this is another beast you don't want to get into a footrace with, back away slowly, or climb a tree.
Panicking will only fuel an out-of-control canine's aggression. So, stay calm. If you're jumped, protect your head, throat and thighs, and try to give the dog something to latch onto that's not you -- like your shirt sleeve.
This one's tough. "No one survives a cape buffalo attack," it's been said. Even climbing a tree isn't foolproof because the buffalo may just wait for you to come down. Your best chance is to shoot it in the brain with the trusty rifle you should have packed.