I get a bit drunk at a friend's house and my friend realizes I shouldn't drive home so he offers to let me sleep on in the guest room until I sober up. I refuse and get behind the wheel and make my way home. On the way I see a flipped car in a body of water near the road. I stop and jump in and save the trapped person.
Did the morally good act of saving a person negate the morally reprehensible act of driving drunk?
The end results don't make your actions in the original instance OK, even if the bad case (wrecking and killing someone) didn't happen but instead a good one did. I shouldn't have been driving since it objectively at the time was immoral and I had no way of knowing what would happen.