Dig a trench 2 feet deep and at least 6 inches wide at the existing fence border all around your garden. Use a spade to outline and begin the trench, then finish digging with the shovel. Pile dirt neatly near the edge of the trench.
Staple the top portion of mesh to the fence posts, about 2 feet above ground level, and fit the lower portion in the bottom of the trench with a 6-inch lip facing away from the fence. This will trap gophers attempting to burrow under the mesh. The mesh must have gaps of no more than 1/2 inch; gophers can fit through very small gaps.
Fill in the trench with the shoveled dirt, and tamp down to hold the mesh in place firmly.
Dig plant beds at least 2 feet deep and as wide as you need for planting. Outline the area and dig with a spade, then finish with the shovel. Pile the dirt neatly at the edge of the bed.
Lie mesh fencing in the trench, covering the bottom and sides completely, with a lip on both sides of about 1 foot.
Fill in plant beds with the soil you removed, then tamp down.