Eleven months ago, when the San Francisco Giants signed Pablo Sandoval to a minor-league deal, the move was derided as typical sentimentality from a team unable to let go of the past.

Ten months ago, when the Giants called Sandoval up to the majors, it was viewed as a nonsense transaction for a terrible team playing out the string in a lost season.

Now? Sandoval to the Giants looks — dare we say? — genius.

“It’s hard to quantify how great he’s been since he’s been back,” Giants first baseman Brandon Belt said. “He’s accepted his role to do anything. You can’t put a value on that. His spirit. His humility. He’s been hugely important.”

The Giants are trying to stay competitive while dealing with a ridiculous number of injuries. They’re trying to change their grim 2017 vibe to a more fun-loving, loose place. They’re trying to remember how to play hard and have fun at the same time.

Enter Panda.

He’s played four positions, including one thoroughly entertaining outing as a pitcher. He’s been a designated hitter. He’s batting .282 and has six home runs. He’s batted everywhere in the lineup save leadoff. He played 18 games at first base, a lifesaver after Belt had his appendix removed. Now, with Evan Longoria out for several weeks, he’s back at his old familiar spot at third for the foreseeable future.

“It’s paying large dividends,” manager Bruce Bochy said of Sandoval’s inclusion on the everyday roster. “With what’s happened with our ball club: to be able to insert him into the lineup every day, wherever we need, but also the caliber of ball he’s playing.”

Before we go further, let’s address the word “large” that Bochy used in the above quote. The knee-jerk reaction would be to make fun of Sandoval’s size in some way. In reality, Sandoval is looking as fit as he has in years. Maybe ever.

“I’ve been working hard every day, doing the little things to keep in the game,” said Sandoval, 31. “You get past 30 it’s tough to lose weight and you have to maintain a routine.”

Does that sound like a more mature Sandoval? Yes, it does. It’s not the only way that Sandoval has changed since he returned after 2½ disastrous seasons in Boston.

“He’s matured so much since the last time he was here,” Bochy said. “It’s how he handles everything. He’s calmer at the plate — he used to swing at everything and now he’s taking a lot of first pitches. He’s a much smarter player.

“And I think he’s a player that really appreciates the game more after what happened in Boston. He realizes that he made a couple of mistakes in how he handled things. But he realizes how much he loves this game.”

Sandoval was shaped by that experience with the Red Sox. After signing a five-year, $95 million contract shortly after winning the 2014 World Series, Sandoval was a disaster. He showed up out of shape, ended up playing only 161 games, hit .237, had 14 home runs and was designated for assignment halfway through the contract, with the Red Sox forced to pick up the remainder of what was owed — minus the major-league minimum to be paid by any team that signed him.

He is loathed, understandably, in New England.

“It was a learning experience,” Sandoval said. “It was a new experience. But it’s past. I’m here and having fun.”

When Sandoval arrived last summer, he wasn’t sure what to expect.

“But this year, I feel like I’m at home,” he said. “I missed having fun for three years and now I’m having fun and enjoying the game and enjoying my teammates. Every moment.”

Sandoval has made a lot of money. He left San Francisco acting a bit like a prima donna, leaving bad feelings in his wake. But he has returned with the mentality of a journeyman, willing to ride the bench or do whatever is asked. He has no expectations that third base is again his position.

“That’s his spot and we’re going to miss that guy,” Sandoval said of Longoria, who is expected to return in July. “I told Bochy, ‘Whatever you need, I’m going to be here. No matter what position, I’m going to be here and do my job.’”

He wasn’t kidding. In late April, he pitched a perfect inning. In late May, he started for the first time ever at second base and robbed a hit.

“He’s mentioned outfield, he’s caught bullpens,” Bochy said. “Whatever we’ve asked, he’s willing to do. He sat on the bench for a week and never complained. He’s the same guy every day.”

That guy was missed, perhaps more in the clubhouse than on the field. Sandoval was always, from his rookie season on, a loud, laughing, loquacious presence. He bridged clubhouse cliques and made up nicknames and occupied the empty spaces in baseball that can too often be filled by tension and worry.

More Information Two Pandas Giants infielder Pablo Sandoval’s 2018 offensive splits as a right-handed hitter (vs. left-handers) and left-handed hitter (vs. right-handers): vs. RHP vs. LHP At-bats 108 31 Average .315 .161 Home runs 5 1 OPS .880 .547 Note: Through Thursday

Read More

“We really missed him,” Bochy said. “There were times when I heard Buster (Posey) say that we missed Pablo in the dugout. He always walks in the door in a great mood, having fun, whether he’s playing or not. It doesn’t matter what part of the game it is, you hear him. He takes the game seriously, but he doesn’t take himself seriously.”

Belt agrees.

“That definitely was missing the last year or so,” he said. “It’s nice to have guys like that. They keep everything loose when stuff’s not going great. They keep you in the right frame of mind.”

Sandoval knows that’s an important part of his “super-utility” role. Being a good clubhouse guy.

“I’ve always been like that, the funny guy, keeping guys loose,” he said. “You know sometimes we think too much. I don’t want these guys to worry. It’s a game, tomorrow’s another day. We have to keep working hard and respect the game but we need to have fun.”

The Giants didn’t have fun last year. This year they seem to be looser, more resilient, less apt to collapse when something goes wrong on the field or another injury strikes.

The difference? It just might be Panda.

Ann Killion is a columnist at The San Francisco Chronicle. Email: akillion@sfchronicle.com Twitter: @annklillion