You can't beat yourself up over this. You did what probably 75% or more of the population would not have done... you went back.
You have a big heart, and you want to do what is best. But as others have said, you have to make sure you're not in any danger (oncoming traffic etc) before you can help the animal in need.
I commend you for going back to check on the dog. That shows so much of your nature and heart.
Bookmarks