Leopards are very cautious hunters compared to their larger cousins in the big cat family. Leopards seek out small, easy prey and often won’t take chances on attacking large creatures.
Avoid traveling at night. Leopards are mainly nocturnal hunters and as a result, are much more active at night. Stay at home or at camp during the nighttime.
Climbing a tree to escape will not help. Leopards are excellent climbers and can scale a tree much faster than you can.
Your goal should be inflicting as much damage as you can to try and dissuade the leopard from continuing to attack. The leopard might flee if it feels you are not worth fighting. An injured leopard cannot hunt, so many leopards will avoid dangerous fights to keep themselves safe.