Two months ago, Mike Foltynewicz was pitching for the Gwinnett Stripers, trying to work his way back to the big leagues.

On Friday night, he pitched eight shutout innings at SunTrust Park in the game that clinched the National League East championship for the Braves.

Could he have imagined such a scenario when he was toiling in the minor leagues throughout July?

“You don’t envision that,” Foltynewicz said amid the jubilation of the Braves’ clubhouse late Friday night, “because when you’re down there, you’re working on stuff, trying to get back up here. But it has been a long year, so over the past six-seven starts I’m really glad to show the team I’ve still got it and can still go out there and win, keep the boys in it.”

In 2018, Foltynewicz was a National League All-Star and the Braves’ best pitcher. But this year, after being sidelined in spring training and at the start of the season by a bone spur in his elbow, he had a 6.37 ERA through 11 starts. He was optioned to Triple-A Gwinnett on June 23, one day after allowing eight runs in four innings against the Washington Nationals.

He made six starts for the Stripers before rejoining the Braves on Aug. 6. He allowed seven runs across 11-1/3 innings in his first two starts back. But since then, he has allowed two earned runs or fewer in each of seven consecutive starts, one run or none in each of his past four. He has a 1.19 ERA over his past six starts.

“Since he’s come back from the minor leagues,” Braves catcher Brian McCann said, “he’s been as good as anybody.”

Foltynewicz elevated his recent success with Friday’s stellar performance in the division-clinching 6-0 win over San Francisco.  He allowed three hits (all by Giants outfielder Mike Yastrzemski), struck out seven and afterward said he appreciated his role in the big night “a lot more” because of all that preceded it this season.

“To keep my head down and keep grinding like I did -- just to be able to be in the spot I am is pretty special to me,” Foltynewicz said. “I had a great support staff, not only here at the field, but my family, my friends.

“After all the stuff that happened this year, (I’m) very proud of myself. ...  But it has been a long year.”

And it’s far from over for him or his team. The Braves are headed to the playoffs for the second consecutive year, with Foltynewicz having pitched the division-clinching game both times. His recent performances heartily endorse him for a spot in the postseason starting rotation.

“Hopefully I’m on that (postseason) roster, bullpen, starter, whatever it is,” he said. “But just over the past seven starts, I’ve kind of shown that I’m still a starting pitcher and  can throw the ball up there and get through six-seven innings and help the team win.”

The pitcher who was 2-5 with a 6.37 ERA in 11 starts before his demotion to the minors? He is 6-0 with a 2.35 ERA in nine starts since his return to the majors.

“It looks like he’s starting to peak right now at a good time,” manager Brian Snitker said.

Foltynewicz believes he “absolutely” is pitching as well now as at this point last year.

“My slider is back. And not only that, we’ve been mixing pitches, using the change-up, using the curveball,” he said. “Getting early ground-ball outs allows me to get deep in the game. The two-seamer has been really good for me lately to get those ground balls. I have been pitching instead of throwing. And we’re here.”

He’s here.