Before the 2014 season, the Yankees signed free-agent center fielder Jacoby Ellsbury to a seven-year deal for $153 million, which meant Brett Gardner was being shifted to left field and out of the leadoff spot.

Before the 2016 season, the Yankees acquired Aaron Hicks from the Twins for John Ryan Murphy and projected him as an outfielder who could play all three positions.

In December 2017, a season after Ellsbury was injured and Hicks took over in center field, the Yankees traded for Giancarlo Stanton to play left field.

Each move seemingly moved Gardner away from regular playing time and when spring training ended this year, he was projected as a fourth outfielder who would play more than the garden-variety extra outfielder.

There was Gardner, however, hitting third between Aaron Judge and Edwin Encarnacion on Friday night when the Yankees blasted the Twins, 10-4, in Game 1 of the ALDS at Yankee Stadium. Stanton batted fifth, Gleyber Torres sixth and Gary Sanchez seventh.

Hicks? He was in Tampa rehabbing a flexor tendon in his right (throwing) elbow.

Ellsbury? He hasn’t played in a big league game since the 2017 ALCS, when he pinch-hit against the Astros to complete a 0-for-9 postseason.

Stanton’s 2018 season was fine, but his second year as a Yankee was ruined by injuries that limited him to 18 games.

So, Gardner found himself in center field, where he started 94 games in the regular season. Gardner started 37 games in left. His 141 games played were third on the Yankees. DJ LeMahieu led with 145 and Torres was second with 144.

Aaron Boone’s decision to hit Gardner third paid off when he blasted a solo homer into the second deck in right off Cody Stashak in the sixth inning, stretching the Yankees’ lead to 7-4.

In an ideal world, Gardner wouldn’t have hit third. With Hicks on the injured list because of a back problem that surfaced in spring training, Gardner hit leadoff in 13 of the first 14 games. Eventually LeMahieu took over in the top spot (he hit first in 125 games) and Gardner, who led off 27 times, slid down. Gardner started 31 games hitting ninth, which was where he hit most often.

Of course, nothing about the Yankees’ lineup has been ideal this year because of injuries. Greg Bird was the starting first baseman on Opening Day against the Orioles and homered from the seventh spot. His season ended after 10 games because of plantar fasciitis.

Due to injuries, Boone used 155 different batting orders in 162 games.

Despite the fact Gardner, 36, hit a career-high 28 homers and drove in 74 runs (another career best) and had a splendid September, the biggest reason he hit No. 3 in Game 1 was because of the side of the plate he hits from .

“Having two lefties, so just trying to, first and foremost, space those guys out,’’ said Aaron Boone, who batted left-handed hitting shortstop Didi Gregorius eighth. “Our lefties have hit in some spots all year because we don’t have a lot of them, especially with Aaron Hicks down. You are just trying to space them out. I feel like the year Gardy has had and matchup here makes sense to have him. It’s clear in my mind to have him that three hole.’’

As for the matchup against the right-handed Jose Berrios, Gardner didn’t face him this year but entered Friday night’s action 4-for-9 (.444) against him.

Before it became chic to bat the best hitter second, the third spot was reserved for the top hitter on the team. That’s why Judge hits second. But since Sept. 10 Gardner has certainly joined the conversation of who is the Yankees’ best hitter entering the postseason.

He went 17-for-54 (.315) with seven homers, 15 RBIs and a 1.121 OPS in 14 games.

Gardner’s stature in the Yankees’ universe never dwindled to an afterthought but nobody coming out of spring training could have seen Gardner hitting third in the first postseason game, either.

Game 1 took four hours and 15 minutes to complete, the second longest nine-inning postseason game in Yankees history. Game 3 of the 2004 ALCS against Boston tops the list at four hours and 20 minutes.

The Yankees’ three stolen bases in the seventh inning established a club record. Cameron Maybin, who ran for Giancarlo Stanton, swiped two.