The Ukrainians attacked Poland from the East in 1939 and drove Polish forces back into the Nazis. The Polish thought they would be able to escape the Nazis by fleeing into Ukraine. The Polish learned never to trust the Ukrainians.
Your history is fuzzy...that was the SOVIET UNION, i.e. RUSSIA, that backstabbed Poland in 1939.