ATLANTA (AP) — Giants manager Gabe Kapler knew that Mike Yastrzemski was close to busting out and ending his frustration at the plate.
"He understands that turbulence happens during a major league baseball season," Kapler said. "He just doesn't let it get the best of him, so it wasn't surprising at all to see him slap the ball down the right-field line today."
Yastrzemski broke out of a slump with a go-ahead two-run double in the sixth inning, Joc Pederson and Austin Wynns homered and San Francisco beat the Atlanta Braves 12-10 on Tuesday night.
Yastrzemski was 1 for his last 19 when he drove a pitch from Collin McHugh to right that put the Giants up for good at 8-7. Pederson connected for his 15th homer in the seventh off McHugh, and Wynns went deep in the second off Spencer Strider as San Francisco snapped a two-game skid.
Kapler has seen the Giants getting closer to stringing together good at-bats as a team. Everything worked out just fine on Tuesday.
"I'm not sure which one to point to," he said. "I thought we did have quality at-bats up and down our lineup and throughout the game and it turned out that we needed every one of them."
Matt Olson homered twice and Ronald Acuña Jr. and Marcell Ozuna went deep for Atlanta, which leads the NL with 105 homers.
The defending World Series champion Braves, in second place in the NL East, had won two straight and 16 of 18 dating to June 1. Atlanta was attempting to move a season-best 11 games over .500, but snapped an eight-game home winning streak instead.
"We kept bringing it around," Braves manager Brian Snitker said. "We just couldn't stop the bleeding a couple of times. When we were up 7-6, I knew we needed to keep scoring. It didn't work."
San Francisco, in third place in the NL West, has won eight of 11 and 14 of 22. The Giants scored three runs in the ninth on Thairo Estrada's RBI single and Wilmer Flores' two-run single.
Darren O'Day (1-1) took the loss after allowing two hits and two runs and failing to retire either of the three batters he faced in the sixth.
Tyler Rogers (1-3) pitched two innings to earn the win.
Acuña's seventh homer was a 409-foot shot off Zack Littell that bounced into the second deck of left field to make it 7-6 in the fourth. Michael Harris II was hit by a pitch before Acuña, who finished 3 for 5, connected.
San Francisco scored twice in the top of the fourth to take a 6-5 lead. Consecutive singles by Tommy La Stella and Brandon Crawford set up Wynns' RBI single that tied it, and Crawford scored on Luis González's sacrifice fly on a call that was overturned after Crawford was originally ruled out.
That chased Strider, who scuffled with six runs and six hits allowed in 3 2/3 innings. Giants starter Anthony DeSclafani, back on the roster after missing nearly two months with right ankle inflammation, didn't fare much better as he was charged with six hits and five runs in three innings.
Ozuna's 13th homer trimmed the lead to 4-2 in the bottom of the second. Travis d'Arnaud reached on a broken bat bloop single and scored when Ozuna connected to left-center with a 427-foot shot.
Dansby Swanson and Austin Riley singled with one out in the third. Olson followed with his ninth homer, a 432-foot shot, that gave the Braves a brief 5-4 lead. Olson's 10th homer cut the lead to 12-10 in the ninth.
Crawford's sacrifice fly and Wynns' first homer, a three-run shot to left, made it 4-0 in the second. Wynn went 3 for 4.
"I just did my part, man," Wynns said. "That's all I wanted to do. It was a battle today. We needed our whole team, pitching, defense, hitting, so it was huge. I'm glad I did my part."
He hit the first Giants homer that wasn't a solo shot in their last 12 long balls, a span of two weeks.
"Heater down and he threw it right down into it," Wynns said. "He's a good pitcher, man. Elite fastball."
Crawford left the game after having d'Arnaud fall on his left leg at home as he slid in safely on González's sacrifice fly. Wilmer Flores came in to play second and Estrada moved to shortstop to replace Crawford, who sustained a left knee contusion. ... Giants LHP José Álvarez was placed on the 15-day injured list with lower back tightness.
Poor fielding hurt the Giants in the seventh. A passed ball by Wynns allowed Acuña, who was running on the play, to advance from first to third. Acuña then scored with two outs to trim the lead to 9-8 when Estrada, standing on second for the would-be forceout, bobbled third baseman Evan Longoria's soft throw on Olson's grounder. Estrada redeemed himself with an RBI single in the ninth that made it 10-8.
San Francisco reliever Camilo Doval threw his glove angrily on the grass after recording the second out of the ninth. Kapler said Doval, who had just given up Olson's second homer, thought it was the third out and was frustrated.
Giants LHP Carlos Rodón (6-4, 2.84 ERA) will take the mound against Braves RHP Charlie Morton (4-3, 5.08) as the teams play the third game of a four-game series. Rodón is facing Atlanta for the first time. Morton is 4-5 with a 2.55 ERA in 14 career starts against San Francisco.