Giants rally late to beat Rockies 3-2