Harden scored a career-high 46 points and Jeremy Lin added 29 as the Rockets beat Oklahoma City 122-119 at Toyota Center for their signature win of the season — on their strangest night of the season.

“He’s just a hell of a basketball player,” Rockets coach Kevin McHale said.”

Before the game, the Rockets made two moves that overhauled much of their roster, saved them money and brought them 2011 No. 5 overall pick Thomas Robinson from the Kings.

On the floor, the Rockets avenged two earlier losses this season in which they lost by an average of 26 points to the Thunder, who currently are No. 2 in the Western Conference standings behind the Spurs.

In those earlier games, Harden shot 26 percent against his former team.

On Wednesday, he started off on fire and didn’t really cool off.

Harden made his first four attempts — all 3-pointers — and finished 7-of-8 from 3-point line. That includes a 3-pointer from half-court at the third-quarter buzzer. He was 14-of-19 from the field and had eight rebounds and six assists.

Lin added eight assists and six rebounds.

Harden’s layup finished a 9-0 run that pulled the Rockets within 109-106 with 3:33 left.

Harden then drilled a 3-pointer to tie the game at 111 with 2:13 left.

He hit two big jumpers down the stretch and clinched his career high with two free throws with six seconds left.

His previous career high was 45 points in the second game of the season against Atlanta.

“However good you thought James Harden was … he’s better,” wrote Chronicle columnist Jerome Solomon on Twitter after the game.

In a dramatic and sudden overhaul of the roster before the game, the Rockets agreed to a pair of deals that will bring them Robinson, the fifth pick of the 2012 draft out of Kansas, and will open about $1.5 million more of cap space next summer.

The Rockets will send starting power forward Patrick Patterson, backup point guard Patrick Beverley and backup center Cole Aldrich to the Sacramento Kings to get Robinson. They will also get guard Francisco Garcia and forward Tyler Honeycutt in the deal. Both have expiring contracts.

In a separate deal, the Rockets agreed to send second-year forward Marcus Morris, Patterson’s backup and Robinson’s former Kansas teammate, to the Phoenix Suns for a second-round pick.