Reds rally in 7th, beat Giants 4-2