On 14 June Auchinleck authorised Ritchie to withdraw from the Gazala line. Stuck in boxes to the north of Knightsbridge, cut of by the Axis who were swarming towards Tobruk. 50th Northumbrian and 1st South African were ordered to break out east while the 15th and 21st Panzer tried to cut them off. The defenders in the El Adem Box and two neighbouring boxes held firm and the 1st South African Division was able to withdraw along the coastal road practically intact. The road could not accommodate two divisions so the remaining two brigades of the 50th Northumbrian had to find an alternative. They could not retreat directly east because of the presence of the Axis armour so, instead, they attacked south west breaking through the lines of the Italian X Corps’ Brescia and Pavia Divisions and headed south into the desert before turning east and heading back to friendly territory. Weary units of 7th Armoured Division managed to delay the German armour allowing most of the 50th Northumbrian to escape and the 1st South African Division, withdrawing along the coast road lost only its rearguard. By now most of the 8th Army was in retreat to the El Alamein line.
General Auchinleck took direct command of the Eighth Army from General Ritchie, reversing the earlier decision to stand a Mersa Matruh and ordered a withdrawal to the secure line between the Qattara Depression and El Alamein. By 27 June Mersa Matruh fell. By now the Western Desert was a full of mixed up units all heading east, and with both sides using each others transport it was difficult for both air forces to know who to attack and mistakes were made by both sides. This retreat became known as the ‘Gazala Gallop’ .
On 1 July After attacking west through the Italian Lines and then swinging east behind Rommel’s forces all the remaining units of the 50th (Northumbrian) Division were on or behind the Alamein Line. 50th Northumbrian did not take part in the First Battle of El Alamein, being held in reserve because it was understrength.