Don't leave food lying around, not even garden scraps - that's what attracts them most. And don't try to scare them off with sudden noises or lights thinking it'll work: they get used to it fast and everything goes back to how it was.
The problem is that wild boars have multiplied quite a lot over the past few years, especially in the north. They don't have many natural predators, food has become easier to find in inhabited areas compared to forests, and there are fewer hunters than there used to be. When a family finds an orchard full of vegetables, they always come back because they know it's a reliable food source. If you start growing again, you'll need to think about serious fencing - not regular netting, but actual barriers at least a meter and a half high, and that go underground because they don't climb easily but they do try to dig underneath.
The real solution though isn't at the individual garden level. Something needs to happen at the provincial or regional level with authorized hunters, because population control only works if it's coordinated across large areas. Talk to your local council or other farmers in the area - maybe they're already thinking about collective solutions. In the meantime, the only thing that really discourages them is making yourselves less appealing than the woods.