  We present a study of the in-plane and out-of-plane magnetoresistance (MR) in
heavily-underdoped, antiferromagnetic YBa_2Cu_3O_{6+x}, which reveals a variety
of striking features. The in-plane MR demonstrates a "d-wave"-like anisotropy
upon rotating the magnetic field H within the ab plane. With decreasing
temperature below 20-25 K the system acquires memory: exposing a crystal to the
magnetic field results in a persistent in-plane resistivity anisotropy. The
overall features can be explained by assuming that the CuO_2 planes contain a
developed array of stripes accommodating the doped holes, and that the MR is
associated with the field-induced topological ordering of the stripes.
