The easiest and best way to sort this is to disconnect both rear lights, and using a test light put each circuit on in turn to see which colour does what, and work from there.
Take your time, and the reward will be proper lights again, oh and buy a dog muzzle !!
If you get stuck pm me.
tabetha