Dogs dig for many reasons, and sometimes it helps to pin down the right reason before you take steps to alter his habits. I've used "he" to refer to the dog throughout this article but most of the points apply equally well to bitches. The only one that doesn't is hormones. If your dog is male and there is a bitch in season near by, he may be trying to escape from your garden by tunnelling. If your dog is female, especially if she has recently had her first season, she may be showing "nesting" behaviour. If this gets very frantic you need to have her checked out by a vet in case she requires medical treatment to help her get over it. Either male or female hormone-inspired digging can be reduced by neutering. Otherwise, the reason your dog digs is most likely the simplest explanation - he is a dog. It's very normal and natural behaviour and many of them go through at least a short time where they do it regularly. If he's a puppy, he may grow out of the digging as he gets older (my own puppy is nearly twelve months at the time of writing; he hardly digs at all, having been a very keen "gardener" at first). You could try waiting him out, or you could read on.
If it's a very recent habit in an adult dog, especially if it only happens in one place, then probably something specific happened to start him off and you may be able to distract him out of it again. Check that there isn't a toy or bone buried in the spot, or that rabbits haven't made a home there. If there's nothing you can see that might be encouraging him, try spraying it with a deterrent spray. These are usually used to stop puppies chewing indoors but can also put them off particular areas outside. It might also help to block his access to the spot for a while till he gets out of the habit. A pile of large stones or rocks, or a temporary wire netting fence round his favourite digging pit may do the trick. If he is adult and it's a long standing habit (or if you try all the ideas above and he simply moves to a new spot) it's easier to limit his activities than to prevent them altogether. Digging is, as we said, a natural doggy behaviour.
Try giving him a small area in the garden where it's OK to dig and nose about. Dig out the plants and put in loose earth or sand, then bury a couple of biscuits in it. Let him see you the first time so he knows the food is there. Tell him he's good when he digs it out. Refill the area with biscuits, toys or bones every few days and praise him when he finds them.
He should soon realise that digging in his corner gets your approval and some treats. This will encourage him to dig there rather than elsewhere. If he begins to lose interest in digging later, just put progressively fewer treats in the area until he doesn't bother going there any more.
If it is impossible to give him a digging area, vigilance is the only answer.
For a while, you will have to go out with him every time he goes, and stay out until he comes back in. Watch him so he can never start to dig unobserved. When you spot him starting, interrupt the behaviour, call him away or distract him with a toy and praise him. Hopefully in time you might break the habit.
A final word - but you knew this already, of course - NEVER try to put him off digging by burying sharp objects where he's likely to dig.Copyright to Debbie Waller of www.padsonline.org and www.dog-behaviour.com