Marco Scutaro and Brandon Belt hit RBI singles in the eighth inning Wednesday to lift the San Francisco Giants to a 4-3 win over the Colorado Rockies in the finale of a three-game series.
The Giants erased a 3-1 deficit with runs in the seventh and eighth innings and won two out of three to take the series.
Hunter Pence and Pablo Sandoval knocked in the other runs for San Francisco.
Guillermo Moscoso (2-2) threw two scoreless innings for the win and Santiago Casilla worked around a single in the ninth to earn his second save.
Yusmeiro Petit started for the Giants five days after taking a perfect game into the ninth inning and went 5 2/3 innings, giving up three runs on six hits and two walks. He struck out seven.
Nolan Arenado had two RBI for the Rockies, who dropped to 1-5 on a nine-game road trip.
Brandon Crawford and pinch-hitter Angel Pagan singled off Matt Belisle (5-7) to start San Francisco's eighth inning rally and moved up on a bunt. Belisle intentionally walked Buster Posey to load the bases, but the move backfired when Scutaro and Belt both singled to make it 4-3.
Troy Tulowitzki had a two-out pinch-hit single for the Rockies in the ninth, but Giants catcher Hector Sanchez scrambled for Charlie Blackmon's bunt and gunned him down at first base to end the game.
"I told our guys that sometimes the reward you get for playing hard is getting your heart broken. You play a lot of close games and a lot of tough games. Inevitably you're going to lose some tough games and that's how it goes," said Rockies manager Walt Weiss.
The Giants went 4-3 on a seven-game homestand. They took an early lead.
Gregor Blanco, Pence and Sandoval singled for the Giants in the third inning with Blanco scoring on Sandoval's hit to make it 1-0.
Petit retired the first 11 Rockies hitters before walking Corey Dickerson with two outs in the fourth. Michael Cuddyer followed with a single and Dickerson scored on Arenado's base hit to tie the game.
Petit, 28, lost a perfect game with two outs in the ninth Friday night against the Diamondbacks and had been 3-0 with a 1.71 ERA in three starts this season before Wednesday -- all since Aug. 27.
"He was good again. Got off to a good start, hit his spots," Giants manager Bruce Bochy said of Petit. "They had some pretty good hitting over there. They found some holes but it wasn't like he was hit hard."
Arenado delivered another RBI single to plate Dickerson in the sixth and Charlie Culberson drove in Cuddyer with a hit to make it 3-1 Colorado and knock Petit from the game.
Left fielder Roger Kieschnick then threw Arenado out at home plate on a single by Jonathan Herrera to save a run for San Francisco.
In the seventh, the Giants pulled within 3-2 after Josh Outman walked the first three batters on 14 pitches and Pence hit a sacrifice fly.
The Giants won the season series 10-9 ... The Giants start a 10-game road trip Thursday with the opener of a four-game series against the Los Angeles Dodgers ...Colorado's nine-game road trip ends with three in a row against the Arizona Diamondbacks starting Friday.