Hernandez had been out with June 8 with a strained right hip flexor. He revealed before Boston's game with Pittsburgh that he also had an internal hematoma in an abdominal muscle on his right side drained in June.
"I've never missed that much time in my career and I kind of felt like I wasn't part of the team in a way," Hernandez said. "There wasn't anything I could do to help the team, so it was very frustrating. I feel like I lost a full season, but I'm glad to be healthy and glad to be back."
Hernandez started at shortstop on Tuesday and went 0-for-3 with an RBI in Boston's 5-3 win. Xander Bogaerts was rested after fouling a ball off his right foot during a weekend series with the New York Yankees.
Hernandez is hitting .206 with four home runs in 52 games.
Red Sox manager Alex Cora said he will use Hernandez at both middle infield spots as well as center fielder. Hernandez was Boston's primary center fielder last season and hit 20 homers when they reached the AL Championship Series before losing to Houston.
The Red Sox are four games out of the AL's third and final wild-card spot. Hernandez is hoping to give Boston a spark down the stretch.
"I've been to the postseason seven years in a row, and I want to make it eight," he said.
The Red Sox also activated infielder/outfielder Rob Refsnyder from the 15-day IL. He had been sidelined since July 30 with a strained right knee.
Infielder Yolmer Sanchez was designated for assignment to open spots on the 26-day and 40-man rosters. The Red Sox optioned outfielder Jaylin Davis to Triple-A Worcester on Sunday night to clear another roster spot.