I had a stud shear off flush with the back of the nut, the rest of the stud was still there so I made up a double length nut, welding the two together, and then filed one end narrow enough to fit into the usefully wide hole on the header clamp. That way it could screw onto the remains of the stud.
Of course, if it is an accessible one and there's enough left of the stud to get a grip on you might replace it... but it's usually one of the inner ones.