BOSTON — The plan for Cameron Maybin’s reentry to the Yankees roster called for the outfielder to play in a few more minor league rehab games and come off the injured list Tuesday, when the Diamondbacks arrive for a two-game series at Yankee Stadium.

When Brett Gardner went on the IL on Thursday with a sore left knee, however, the Yankees discussed moving up Maybin’s return date and decided late that evening the veteran would be the choice. He joined the team in time for Friday night’s game against the Red Sox at Fenway Park, and was in left field hitting seventh.

Out since June 22 with a strained left calf, Maybin played in three games for Triple-A Scranton/Wilkes-Barre and hit .462 (6-for-14) with a homer and two RBIs.

Maybin, who hit .314 with five homers and 14 RBIs in 42 games before being hurt, was the choice over fellow outfielder Clint Frazier.

Maybin said he felt physically ready a while ago, but needed to hone his swing.

“I needed at-bats for myself,’’ said Maybin, who went 1-for-3 with a walk in the Yankees’ 10-5 loss to the Red Sox on Friday night at Yankee Stadium.

General manager Brian Cashman said the move to return Maybin from his rehab stint instead of calling up Frazier was because of the Yankees’ roster situation — and not a knock on Frazier.

“Maybin was coming back,’’ Cashman said. “Clint Frazier is definitely playing exceptionally well now. He’s worked hard on his defense, so he’s a legit option, as he’s always been, but to have him here for a day [and] when Maybin comes off the [injured list], to spin back around, doesn’t make any sense.”

Cashman added Maybin might have been back from his left calf rehab by Friday, which would have required another move.

“Just the way our roster was shaking out, we needed the extra arm [Thursday in Stephen Tarpley], so we brought Maybin [back Friday],’’ Cashman said.

Frazier, who has had issues on defense is “not not an option,’’ according to Cashman.

“He’s a legitimate force and obviously helped us a lot in the win column earlier in the year,’’ Cashman said. “And when needed, has a chance to be a choice for us as we move forward.”

In 28 games since being sent to SWB on June 16, Frazier was hitting .275 (30-for-109) with five homers and 13 RBIs. Since July 15, Frazier was batting .433 (13-for-30) with four homers and six RBIs.

Maybin said there wasn’t a better place or time to come off the IL.

“It’s a perfect way to come back, a lot of excitement,’’ Maybin said of returning to face the Red Sox. “I am excited to be back for this.’’

Aaron Boone said he wasn’t worried Maybin’s rehab stint was cut short.

“Would it have been ideal to get another game or two?” he asked. “OK, but I feel he has been physically he has been in a good spot for a couple of weeks right now.’’

When Gardner comes off the IL he could take Mike Tauchman’s roster spot, but it would be very hard to remove Tauchman from the roster after the way he has hit. Tauchman went 3-for-4 in Friday night’s loss and is hitting .500 (20-for-40) in 13 July games.

Gardner returned to New York after being put on the IL Thursday with a sore left knee.

Dellin Betances didn’t throw on Friday, but is scheduled to play catch on flat ground from 90 feet on Saturday for the second time.

Considering the injury history of the 2019 Yankees every time a regular isn’t in the lineup Aaron Boone is rightfully asked, “Is it just a day off?’’

With Aaron Hicks not in the lineup against Red Sox right-hander Andrew Cashner on Friday night, Boone said that the switch-hitting center fielder was getting a day off.

There was not much new with Giancarlo Stanton’s rehab program, but Boone said there is a possibility the right fielder, who is on the IL with a sprained right knee, could begin working on a treadmill which might lead him eventually to participating in baseball activities.