The Giants trailed 5-3 entering the bottom of the ninth inning, but rallied for three runs to walk off with the 6-5 win over the Padres.