Not OP, but never turn your back and run - to a growling dog. I was once stuck with an unfriendly pitbull in a high fenced backyard(the dog's backyard). Once it is staring and growling at you, try to slowly back out of its territory. You will definitely find it hard to take your eyes off it.
Stand your ground in full posture, get ready for it to launch at you. Dodge hard left or hard right while throwing your hands infront of you (only if you have thick sleeves), I luckily had a thick winter coat and it nibbed the sleeve as I jumped hard left (Kind of like the matadors). It recovered and got back to the low growl staring contest before launching again.
It also matters where you position yourself, after it launches their inertia takes them some time to recover which gives you time to get closer to your exit. Just a few more of these and you are on your way out of trouble.
The owner luckily came out after it's second launch at me. It launched again at our hands when I tried to shake the owners hand to show I am friendly (not a great idea once they think you aren't). He keeps telling all my friends I am afraid of dogs..
The dog was calm and peaceful when I had entered the yard, I made the mistake of pulling my hoody over my head, it did not recognize me as the same person after that. Don't change your appearance especially when on foreign territory.
Looking back, the thought of fighting it physically never crossed my mind - I got tense and recognized I shouldn't show fear or my back. Once I figured I could survive dodging side to side, it was a relief.
TLDR - Dont turn your back, get ready to dodge and move as many times as it takes, also avoid changing appearance on foreign dog territory.