Jorge L. Ortiz

USA TODAY Sports

SAN FRANCISCO – Coming off a 2-5 trip to start the season, the San Francisco Giants were looking at Monday’s home opener as a chance to reboot and change direction.

Then Buster Posey got hit in the head by a pitch and all the worries about the lousy start shifted to the franchise player’s well-being.

From all indications, Posey did not sustain a concussion when Arizona Diamondbacks starter Taijuan Walker nailed him on the side of the helmet with a 94 mph fastball in the first inning, though he left the game right away.

The Giants went on to secure a 4-1 victory to improve to 14-4 in home openers at AT&T Park, but the focus afterward was on the condition of the All-Star catcher.

“He’s fine right now. We’ll continue to keep an eye on him. We’ll reevaluate him tomorrow,’’ manager Bruce Bochy said of Posey, who figures to get Tuesday off. “He might have stayed in the game if he wasn’t a catcher. If he takes another shot, now you’re asking for trouble.’’

The sight of the Giants’ most indispensable player stunned on the ground and unable to continue was unsettling enough for a capacity crowd of 42,129, which booed Walker the rest of the way, but the team has also had several players in recent years miss significant time because of concussions. Starting first baseman Brandon Belt and Gold Glove second baseman Joe Panik have been among them.

Though Posey was not available after the game, but teammates Matt Moore, Brandon Crawford and Jarrett Parker said they spoke with him and he seemed normal.

It wasn’t just the fans who were unnerved by the beaning. Walker, who passed along his apologies through news reporters, acknowledged it impacted him.

“I was a little bit shaken up after hitting Posey in the head,’’ said Walker, adding he stopped going inside to right-handed hitters. “It’s always a little scary and I never want to do that.’’

Moore helped soothe his club by shackling the hot-hitting Diamondbacks, who brought the majors’ best record into the matinee. That 6-1 mark – highlighted by a weekend sweep of the defending American League champion Cleveland Indians – was built on a potent attack that was producing 6.86 runs a game, tops in baseball.

The Diamondbacks, who replaced their manager and general manager after last year’s disappointing 69-93 finish, had also displayed their renewed might in taking three out of four from the Giants in Phoenix last week.

This time Moore held them at bay, cruising through eight innings on 93 pitches while yielding just three hits and no walks.

“It’s kind of nice to have some quick innings on my side. It’s not what I’m particularly known for,’’ Moore said. “It’s nice for the outfielders. Everybody’s kind of in and out, and put the pressure back on them.’’

Moore even contributed to a bizarre, game-turning three-run rally in the fourth.

With the bases loaded and one out, Moore hit a squibbler to the left of Walker, who had a forceout at the plate but threw wildly past catcher Jeff Mathis to allow the game’s first run to come in. Panik darted in from second, and Mathis’ throw eluded Walker, giving Parker a chance to score as well.

In essence, Moore hit a three-run 40-footer.

“That was fun. I enjoyed it,’’ said Parker, who also got his first hit of the season. “I got fired up there. Putting three runs on the board for the team was really exciting.’’

New closer Mark Melancon pitched a scoreless ninth to earn the save while introducing himself to the home fans on a positive note. This was what the Giants had in mind when they signed him to a $62 million contract in the offseason.

Things didn’t go as planned the first week, when San Francisco squandered leads eight times, conjuring memories of a bullpen that blew 30 saves in the regular season last year and had spectacular meltdown in Game 4 of the Division Series.

Melancon coughed up a ninth-inning lead in a season-opening loss to Arizona and did not get a chance to redeem himself until Sunday, when the Giants ended a four-game skid.

“No question, we had a rough trip, had a couple slip away,’’ Bochy said. “With the home crowd and opening day here, I thought it energized the players so much.’’

And the encouraging reports on Posey allowed them to fully enjoy the return home.

Gallery: Best photos of the day