That gave Clayton Kershaw a win in the ninth revival of his matchup with Bumgarner and added to Hernandez's ridiculous stats against left-handed pitching -- .395 for his career, best among current players with a minimum of 100 at-bats. Hernandez also had the game-winning hit Thursday night.
"I worked out after the game last night," joked Hernandez. "Feeling strong."
Hernandez also beat the Giants with his glove, making a diving catch in left field to rob Buster Posey of a two-run single in the third inning, when the game could have turned the other way.
The Dodgers video board didn't miss the chance to mark Jackie Robinson Day with a between-innings tribute to the Hall of Famer by Hernandez, who noted that Robinson broke down baseball barriers for more than just African-Americans.
"He also did it for Latinos," Hernandez, a Puerto Rican native, said in the video. "If it wasn't for him, I probably wouldn't be playing baseball in the United States, so I'm thankful for that."
"That was cool," Hernandez said after the game. "I wish I could wear No. 42 more often."
Hernandez's first homer was on Bumgarner's first pitch of the game and Statcast™ projected it traveled 451 feet away from home.
"The Rickey rally," manager Dave Roberts said, comparing Hernandez's leadoff homer to those by the leadoff hitter of all leadoff hitters, Rickey Henderson. "When he gets the opportunity to play, he's aggressive in the strike zone. He always hits velocity and he likes the ball close to him. Madison challenges guys, like our guy Kersh."
After the Giants tied the game on an unearned run in the top of the third, Hernandez homered again in the bottom of the inning. His double, and Charlie Culberson's two-run single, came in a four-run fourth inning that set up the win. Hernandez is 10-for-16 lifetime against Bumgarner, who is 4-3 against Kershaw.
Hernandez said he knows his role is as a versatile sub and doesn't get caught up worrying about playing time.
"I can't really get carried away by all that," he said. "Howie can play left, Trayce is a true outfielder and doing well. I just have to stay calm. I learned a lot last year, so when my name is called I'll do anything I can to help the team."
Ken Gurnick is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.