Javier Hernandez completed Manchester United's late second-half comeback to earn a 3-2 victory over Stoke City at Old Trafford.