Mobilized prior to the outbreak of the Polish Defensive War of 1939, Heda fought in the ranks of the Polish 12th Infantry Division in the area of his home town of Iłża and then in the area of Lublin. After his division was disbanded he was trying to find his way to Hungary, but was arrested by the Soviet NKVD and imprisoned in the Brześć Fortress. After the outbreak of a Nazi-Soviet war when the prison was taken over by the Germans, he managed to escape from the prison camp.