Hitler wanted the restoration of Danzig to Germany and also the return of the Polish Corridor. Britain and France had realised by now that it was not possible to appease Hitler and made a commitment to defend Poland.
In August, Nazi Germany and the Soviet Union signed a non-aggression pact. This was a promise not to fight each other. Joachim von Ribbentrop, the German Foreign minister, went to Moscow with full authority to negotiate an agreement. The agreement publicly stated that there would be non-aggression for ten years and made economic agreements.
There were however secret elements to the agreement. Both countries agree to help each other if there is a war against Poland. Crucially this gave Hitler the freedom to invade Poland without having to worry about the Soviet Union.
The Pact was an amazing U-turn. Hitler had always stressed that the Soviet Union was his main enemy, ruled by 'Jewish Communists' and 'subhuman Slavs'. It was the main focus of Lebensraum.
It was a masterstroke because:
it left Poland isolated
it destroyed attempts by the West to bring the Soviet Union into an alliance against Germany
Germany avoided being dragged into a war on two fronts
Germany gained vital raw materials from the Soviet Union that helped rearmament