If they do aggro on you, try and place yourself in an open area with cover in two directions. Choose where you are going to collapse into a graceless bloody heap. That way there is a bigger chance they will wander off while you are watching the birdies, but if they don't you have a couple of alternate directions to leap and run to try to get into cover so you can sneak off.
Also, while ko'd and watching the birdies, set your speed to your fastest available, and start spam left clicking. Ideally you want to discover that you have become conscious because you are halfway behind a tree on your feet when you open your eyes again.
If you have an option when running from boars run for the water and not for you house. If you can lead them away from the area where you are hunting/building/working you are better off than if you are trying to build a roundpole fence around your hearth but you keep leading them back to the work site.
And hard as it is to believe, it is actually possible to outrun a boar on forest terrain, so carry a couple of full flasks or a waterskin, if you can get them, and prepare to run until you can't anymore, use up your brief lead in gulping water to restore your stamina and go back to running again.
It is extremely easy to lose a boar or any other aggro'd aggressor (except hearthlingam sapiens) on the wide shallows of a lake. They can't pathfind you in the water and you don't need to go ashore to get around bumps in the land and shoreside trees. And once you start wanting to revenge kill that boar, standing in the shallows of a lake might be a good place to try it from...
