Linsanity lasted just one season at the Garden — a few months, really, as magical as they were — before he left the Knicks in 2012.

More than three years later, Jeremy Lin is finally playing closer to those standards with the Charlotte Hornets, who signed him as a free agent this summer to a bargain-basement two-year contract for $4.4 million.

Despite their point-guard needs, the Knicks weren’t interested this past offseason, and that’s no surprise considering Carmelo Anthony’s presence.

There’s a perception Anthony became jealous of the Linsanity phenomenon, feeling overshadowed when former Knicks coach Mike D’Antoni handed Lin the keys to the offense. When the Rockets revised their offer sheet, adding a poison-pill final year that paid Lin a total of $25 million over three years, Anthony called it a “ridiculous’’ amount.

A new and improved Lin, averaging 11.5 points, is back at the Garden on Tuesday as the Hornets’ sixth man, and surely some old Knicks Lin jerseys will be seen in the crowd.

Does Lin feel Anthony did not respect his game?

“I don’t know, I can’t speak on behalf of him,” the former Harvard star said at Charlotte’s morning shootaround Tuesday at the New York Athletic Club. “He’s been great, cordial and nice to me every time I’ve come in contact with him. I don’t feel there’s any issues. That’s probably a question directed at him.’’

It was a surprise Lin chose the small-market Hornets after playing in the larger markets in the Bay Area, New York, Houston and Los Angeles (last season with the Lakers). Lin said he had a chance to rejoin his hometown Warriors, but he wanted a bigger role.

“I entertained it,’’ Lin said. “I just felt like they had something great going there, and if I went there, it would be a very limited role. I felt like, ‘I’m 27 now.’ I want to find where I can be as big a part of a successful team as I can.’’

Lin admitted the Hornets were not originally on his radar.

“We had a few teams on our list we thought would be good,’’ Lin said. “Funny how God works things out. Charlotte wasn’t on the top-six list, but I ended up here. That’s how it ends up for me. It always ends up the way I never imagined. Ever. I wasn’t surprised. I’ll be surprised when things are pretty smooth and clear.’’

This will be Lin’s fifth trip to the Garden as an opponent since Linsanity swept the city, then the world in February 2012.

“When I come to the Garden, I always remember that time and the fans,’’ Lin said. “There’ll still be fans who root for me and cheer and wearing my jersey. I’ll always be thankful for that. Not something you forget easily. Being so many years out, four years out, I would say every time I come back, it comes a little bit more normal. But I’d say it’ll never be fully normal.’’

Hornets coach Steve Clifford is ecstatic because Lin plays both guard positions — a league trend. Clifford says the scouting report on Lin has changed. He’s improved his left hand — he always used to drive to his right — and he’s become a capable defender and 3-point shooter, which was Charlotte’s major weakness in 2014-15.

“He’s a bargain,’’ Clifford said.

When Clifford worked with D’Antoni for one season with the Lakers, the former Knicks coach always raved about Lin.

“Mike always wanted to try to find a way to get him on his team again,’’ said Clifford, a former Knicks assistant coach. “He told me Jeremy’s a worker.’’

There could be a lot of career left for Lin after his market value diminished, especially after a forgettable stint with the Lakers under Byron Scott.

“It’s not so much proving to other people, but being free, having that happiness on the court again, instead of being put in a box,’’ Lin said. “It really was a lot more personal than me wanting to do the things I knew I’m capable of doing, playing the way I know I could, not anyone’s perception of me. I might not have the same usage rate as I had in D’Antoni’s system, but I’m a different player in that I can do more things.’’

He’s doing it in the unlikeliest of places in Charlotte.