Slowly back away with no sudden movements. Carry a larger caliber pistol or even better a rifle, oddly the AR-15 is effective. That 30 round magazine carries a lot of grief in it.
Most importantly never go into pig country without a firearm. Pigs are smart. They have seen and heard gunshots and their fellow pigs drop dead from such. They know it brings death. If you shoot and miss they will probably run away. If he every starts to charge you he will not stop. You must kill the pig to survive.
A big pig can kill you, their tusks are extremely sharp. You can not outrun a pig, they are fast.
Funny Story about one very bad ass army dude that lived in my house near Fort Hood, My house is isolated out in the woods some 20 miles southeast of Fort Hood. We have wild pigs. We were sitting outside at night having a drink as is normal. We heard the sounds of a pig in my woods. Ski said he wanted go down and look at it. I told him twice do not go down there without a gun. He went anyway without a gun.
A few minutes later I hear Ski’s running like hell footsteps. He said, “The F-—ing pig was 3 feet tall and just looked at me.” I informed him the pig was deciding to kill him or not. He got lucky.
Having heard about the boars and their lack of fear I slapped a loaded magazine into the M-23 and focused. Minutes passed as the creature took it's sweet time approaching. Emerging from the brush came...
the world's loudest armadillo. I threw him a cracker and he ran off.