DENVER — Alex Dickerson had a career-best four hits, including the go-ahead RBI single in San Francisco's four-run 10th inning as the Giants recovered from blowing a three-run lead in the ninth to beat the Colorado Rockies 8-4 on Tuesday night.

Mike Yastrzemski homered and doubled among his three hits and had three RBIs for the Giants, who have won seven of their last eight games including four in a row.

Trevor Story and Ian Desmond homered for the Rockies, who have lost 10 of 12.

Trailing 4-1 going into the ninth, the Rockies rallied off Giants closer Will Smith (3-0). Story connected for his 21st home run of the season to start the inning. One out later, Daniel Murphy singled and Desmond followed with a drive that reached the centre field seats to tie it. It was the second blown save for Smith in his last three chances after converting 23 straight to start the season.

But the Giants answered by rallying off Rockies closer Wade Davis (1-4). He issued two one-out walks before Dickerson singled to right as the Giants regained the lead. Brandon Crawford followed with an RBI single and Bryan Shaw relieved Davis. Yastrzemski singled to drive in another run before the Giants scored an unearned run on third baseman Nolan Arenado's fielding error.

Mark Melancon pitched a scoreless 10th.

Ahead by a run, the Giants added to their lead in the top of the eighth. Scott Oberg issued a leadoff walk to Brandon Belt and after Buster Posey moved him up with a single, he scored on Dickerson's single, his third basehit of the night.

Yastrzemski added another run on the top of the ninth, driving the first pitch he saw from reliever Chad Bettis over the left-centerfield fence for his seventh home run of the season.

The Giants took a 2-0 lead in the second inning when Dickerson led off with a single and scored one out later on Yastrzemski's double. Yastrzemski came home on Joe Panik's single.

The Rockies began their half of the sixth inning with a walk by pinch hitter Garrett Hampson and single by Charlie Blackmon. Trevor Gott relieved Drew Pomeranz and Hampson scored on Trevor Story's fielder's choice. Nolan Arenado was hit by a pitch on his left hand, putting runners at first and second with one out but the threat ended when Daniel Murphy's sharply hit grounder up the middle was stopped by shortstop Crawford who stepped on second and quickly threw to first to turn the inning ending double play.

TRAINER'S ROOM

Giants: RHP Johnny Cueto is expected to begin throwing in rehab games in Arizona during the first week of August, said Giants manager Bruce Bochy. Cueto is on the 60-day injured list after undergoing Tommy John surgery last Aug. 2. The Giants and Cueto are hopeful he'll return to the mound before the end of this season. ... 3B Evan Longoria, who was placed on the 10-day injured list because of left foot plantar fasciitis on Sunday, is expected to be re-evauated by team doctors after the club returns home Wednesday evening from its seven-game road trip.

WHAT A CATCH

Giants centre fieder Kevin Pillar took away extra bases from pinch-hitter Tony Wolters in the bottom of the eighth inning with a spectactular diving catch. Wolters, leading off the inning, sliced a sinking liner to centre. Pillar, playing back, made for the ball on a dead run and then dove for it, snaring the ball as he tumbled on the ground and then holding his glove up for the umpire to see that he had made a clean catch. For an encore, he made another diving catch in the bottom of the 10th, snaring Story's sinking line drive for the second out of the inning.

MAKING A MOVE

RHP Sam Coonrod, who served as the 26th man for the Giants during Monday's doubleheader, has been sent back to Triple-A Sacramento. In addition, the Giants optioned Dereck Rodriguez, who got the win in the nightcap, to Sacramento and recalled LHP Andrew Suarez from their top farm club. Suarez will work out of the bullpen.

UP NEXT

Giants: Rookie RHP Shaun Anderson (3-2, 4.48 ERA) will be facing the Rockies and starting in Coors Field for the first time in his young career. He set to make the 12th start of his career.

Rockies: RHP Jon Gray (9-6, 3.83 ERA) has gone 4-1 with a 3.26 ERA in eight starts at home this season.