High-temperature superconductivity in copper oxides occurs when the materials are chemically tuned to have a carrier concentration intermediate between their metallic state at high doping and their insulating state at zero doping. The underlying evolution of the electron system in the absence of superconductivity is still unclear, and a question of central importance is whether it involves any intermediate phase with broken symmetry. The Fermi surface of the electronic states in the underdoped 'YBCO' materials YBa2Cu3O(y) and YBa2Cu4O8 was recently shown to include small pockets, in contrast with the large cylinder that characterizes the overdoped regime, pointing to a topological change in the Fermi surface. Here we report the observation of a negative Hall resistance in the magnetic-field-induced normal state of YBa2Cu3O(y) and YBa2Cu4O8, which reveals that these pockets are electron-like rather than hole-like. We propose that these electron pockets most probably arise from a reconstruction of the Fermi surface caused by the onset of a density-wave phase, as is thought to occur in the electron-doped copper oxides near the onset of antiferromagnetic order. Comparison with materials of the La2CuO4 family that exhibit spin/charge density-wave order suggests that a Fermi surface reconstruction also occurs in those materials, pointing to a generic property of high-transition-temperature (T(c)) superconductors.