As Jim has noted, WA was lost as soon as an enemy unit entered the hex. Neither unit has WA after the withdrawal but the ATTACKER can claim it in the next RPh.
9.322 A unit claiming WA must always be marked with a "Wall Advan" counter. Placing a "Wall Advan" counter and claiming WA are synonymous, as are removing a "Wall Advan" counter and forfeiting WA [EXC: 9.323]. A Pinned, TI, or Immobile unit cannot voluntarily claim or forfeit WA. Claiming WA is voluntary [EXC: 9.323], and can be done by a unit at five times: during its setup; at the end of any RPh (step 1.32B of ASOP, ATTACKER first); during its MPh/APh (either as part of, or before/after MF/MP expenditures); when losing HIP status; whenever all enemy units lose/forfeit WA over shared wall/hedge hexsides. WA must be forfeited immediately if a unit no longer fulfills 9.32 and may be forfeited at any other time. Claiming/forfeiting WA is not considered an action for RPh limits (A3.1) or concealment loss (A12.141). Claiming/forfeiting WA can never be done between an enemy action being declared and that action being completed, e.g., fire vs the unit claiming WA.