It happens to everyone - you line everything up, look down for two seconds to pick up your drill/sneeze/answer the phone/etc. and, without knowing it, you slip a fraction and end up drilling just off where you wanted to. You could have also just been an idiot and marked it out wrong.
The problem now is that the hole you just made is too close to where it should be. This could mean that the drill just slips into the existing hole, making it difficult to put it where it is supposed to and/or it creates a weak point so your project will crumble under its own weight!
The solution is quite simple - plug the hole so it's like the hole was never there!
Step 1: Materials and Tools
The following list will have to be varied to suit you individual application, but this will give you an idea of what I do.
Drill bit that matches your dowel
Dowel (either same size or bigger than the hole you are plugging) - make sure to match the parent material, e.g. Pine dowel for pine, oak dowel for oak wood.
Filler if there is plasterboard as well (and the hole is not being covered with something else)
Step 2: Drill, Cut and Plug - So Easy I've Made It a Single Step!
I have added some shots of a mock-up I did to demonstrate what is going on This has a piece of pine with a piece of ply stuck to the top (I didn't have any plasterboard, but this lets you get the idea). In this case, I have marked out holes I want and then drilled just off centre.
The holes are then plugged with a piece of dowel and cleaned up, then the hole re-drilled where it was supposed to be. In this example I was rushing and re-drilled at an angle so the bottom of the dowel is missing in the cross-section, but I hope this gives you a good idea of what is going on under the surface. The hole on the right has the plug set below the top layer so that this space can be filled before re-drilling (as this was just an example, I skipped this step to save time).
Next is the real-world example I wrote originally.
If you have screwed into the hole, or the sides of it aren't smooth, you need to drill it out so there will be good contact between the parent material and the dowel.
It's great to use a drill bit with a depth gauge on it, but you could use the depth gauge of your drill (if it has one), or mark out the depth on the bit itself with some tape.
This will give you consistent holes and let you know how long to cut your pieces of dowel.
I'm putting up shelves directly over the hole in this example, so my dowel will be cut to the same depth as the drill bit.
If the patch was going to be visible and need painting over, I would cut the dowel to the depth of the hole minus the thickness of the plasterboard/drywall/Giprock (usually 12mm).
Fill the hole with glue and smear some on the dowel then hammer it in. Use an offcut of dowel to drive it in without the hammer damaging your wall and to push it in past the plasterboard.
Wipe up the excess glue and wait for it to dry and cure before drilling again or finishing the top with filler (to be painted over later).