The application of large magnetic fields ($B sim B_{c2}$) to layered cuprates suppresses their high temperature superconducting behaviour and reveals competing ground states. In the widely-studied material YBa$_2$Cu$_3$O$_{6+x}$ (YBCO), underdoped ($p sim 1/8$) samples show signatures of field-induced electronic and structural changes at low temperatures. However, the microscopic nature of the field-induced reconstruction and the high-field state are unclear. Here we report an x-ray study of the high-field charge density wave (CDW) in YBCO, for doping, $0.1 lesssim p lesssim 0.13$. For $p sim 0.123$, we find that a field ($B sim 10$~T) induces new CDW correlations along the CuO chain ($b$) direction only, leading to a 3-D ordered state along this direction at $B sim 15$~T. The CDW signal along the $a$-direction is also enhanced by field, but does not develop a new pattern of correlations. We find that field modifies the coupling between the CuO$_2$ bilayers in the YBCO structure, and causes the sudden appearance of 3D CDW order. The mirror symmetry of individual bilayers is broken by the CDW at low and high fields, allowing recently suggested Fermi surface reconstruction.