Teoscar Hernandez’s three-run home run in the top of the seventh wiped away a one-run deficit and propelled the Dodgers to a 5-3 win over the Phillies.