The answer was staring them in the mirror the whole time.

It took them long enough — 10 baffling, confusing, head-banging losses — but the Red Sox finally executed a tried-and-true game plan yesterday in their first victory in a dozen days, an 8-6 come-from-behind win over the Braves at Turner Field.

The rediscovered bats of David Ortiz and Dustin Pedroia, along with disciplined plate appearances, aggressive baserunning, effective relief pitching, superb defense (and an assist from a vocal fan base visiting the Atlanta ballpark) were enough to overcome a very good team.

Just like old times.

Even though starter Clay Buchholz pitched as if he were powerless to stop the streak — he walked eight batters in only three-plus innings, an individual effort that probably places his spot in the rotation in jeopardy — the Red Sox this time managed to beat back negativity for at least one nine-inning span.

“We’ve lost a lot of different ways — the bottom line is we’ve got a long way to go, a lot of games,” said Pedroia. “We can win 10 just as easily as we can lose 10. Guys are going to keep fighting and trying the best we can to play the game the right way and come out with as many wins as we can.”

Buchholz had the Red Sox down 6-1 after four innings, but in the fifth, they figured out Braves starter Ervin Santana the third time around the lineup.

Santana had been nearly unhittable, but pinch-hitter Daniel Nava drew a two-out walk, Brock Holt singled and Xander Bogaerts received a free pass to load the bases. Pedroia drove in two runs with a single and then Santana threw a back-door slider to Ortiz, who waited on it long enough to drive it over the wall in left-center, a three-run home run that tied the game at 6.

In the seventh, after an 86-minute rain delay, the Red Sox loaded the bases again — Holt hustled down the line for an infield single, followed by back-to-back walks to Bogaerts and Pedroia — this time for Ortiz. He hit a deep drive to right to put the Sox ahead with a sacrifice fly.

And Andrew Miller, whose luck has been horrible of late, had a break turn his way when center fielder Jackie Bradley Jr.’s strong throw helped nail Jason Heyward at second base, which he had overslid in an attempt to stretch a single in the eighth.