October 15, 2020 | 2:55am

Jose Altuve shook off two of the worst games of his career to lead the Astros to a 4-3 win over the Rays in Game 4 of the ALCS on Wednesday in San Diego to keep their season going.

The second baseman, who made three errors in his previous two games, hit his third first-inning homer of the series and added an RBI double.

Perhaps most importantly, he made two plays at second base without any throwing issues.

Asked how he put the previous two games behind him, Altuve said, “I didn’t have a choice.”

“It was [win] today or go home and I didn’t want to go home,’’ Altuve said. “I turned the page pretty quick, showed up today ready to help my team.”

Jose Altuve, who homered in the first inning, doubled in the third inning of the Astros' 4-3 Game 4 win over the Rays.
Jose Altuve, who homered in the first inning, doubled in the third inning of the Astros’ 4-3 Game 4 win over the Rays.Getty Images

Altuve wasn’t tested much in the field, but his case of the yips didn’t bother him on a routine grounder by Yoshi Tsutsugo to end the bottom of the fourth and he then made a strong throw to second on a Joey Wendle forceout in the ninth.

A pregame pep talk from Dusty Baker also helped. Baker moved Altuve from second in the lineup to third.

The manager told Altuve he made the switch because Hall of Fame second baseman Joe Morgan — who died Sunday — hit third for the Reds on their World Series-winning teams in 1975 and ’76.

“He’s swinging the bat great,’’ Baker said of Altuve. “I told him another second baseman, little Joe Morgan, batted third for the Big Red Machine and he told me, ‘Hey, man, I’m ready.’ ”

It was a much different outcome than in Game 3, when an Altuve miscue in the sixth inning led to five runs by the Rays. Later in that game, Altuve’s night got worse when he came to the plate with a pair of runners on base and struck out on a questionable call on a check swing.

“Obviously, he takes a lot of things to heart and prides himself on every aspect of his game,’’ George Springer said. “To start to show people who he is again as a player, he’s our leader and he’s doing what we expect him to do.”

Altuve admitted the prior two games were difficult, when he was visibly despondent on the field and in the dugout.

“It’s not easy to do things against your team,’’ Altuve said. “For me, to not contribute and play [well], I feel bad.”

He’s confident Wednesday’s performance in the field proved his issues were behind him.

“That’s the way I always do it,’’ Altuve said. “I don’t want to think too much about throws because that’s when you make a mistake.”