Knock the moles back into the ground with your hammer as soon as they pop their heads up out of the ground.
Do not allow five moles to appear out of the ground at the same time.