Some dogs get a heap of satisfaction and enjoyment through digging up your yard. It's not that they intentionally want to destroy your impeccable flower bed, just that they love digging.
Some dog owners have resigned themselves to the fact that their dog will dig up their yard regardless of what they try, others decide they won't tolerate it.
One way that you can guarantee to keep your dog from digging up your garden is to install a small electric fence at its perimeter. Electric fence's are cheap to buy and extremely easy to set up. They don't do any real harm to your dog either, they only give a very minor flick to encourage your pet not to enter the garden. Don't worry if you have children as these fences can be adjusted to a very minor level that won't hurt your child should they touch it.
You can try placing foul moth balls throughout the garden - this is a technique that is very effective but also has a downside. First, the positives: your dog will hate the smell of these and stare clear of the garden, they are also totally harmless and can be hidden out of sight. The only real downside is that you'll need to replace these from time to time, especially it it's been raining.
You can also try using a spray deterrent. Bitter apple spray is very effective and easy to use. You simply spray it around the garden every few days and your dog will not want to dig there. Bitter apple dog deterrent can also be used to stop your dog from chewing household furniture and opening the trash bag. Once your dog becomes accustomed to the smell, it will stay well clear off the area.
Dog's dig because they are conditioned to do so. Its in their blood. If you work consistently to stop your dog digging using the tricks mentioned above, you should be able to almost totally eradicate the problem.
Make sure you are persistent and from when training your dog not to dig. Don't expect results overnight and prepare yourself for the occasional digging spree. In time and with persistence your dog will learn to stop digging.