Diamondbacks rally from six down, beat Giants 7-6