Patrick Bailey hit a tiebreaking three-run double in the fifth inning, fellow rookie Casey Schmitt hit his first homer since in 3 1/2 months, and the San Francisco Giants beat the Atlanta Braves 8-5 to avoid a three-game sweep. The Giants won for just the sixth time in their last 20 games to slow a slide that has dropped them out of a wild card position after they once held the top spot. Marcell Ozuna hit his 29th home run for the Braves, who had won four straight. Reliever Scott Alexander (7-2) pitched 1 1/3 innings to pick up the win and Camilo Doval pitched a perfect ninth for his 34th save — snapping a streak of four consecutive blown chances.