The properties of glass are determined not only by temperature, pressure, and composition, but also by their complete thermal and pressure histories. Here, we show that glasses of identical composition produced through thermal annealing and through quenching from elevated pressure can result in samples with identical density and mean interatomic distances, yet different bond angle distributions, medium-range structures, and, thus, macroscopic properties. We demonstrate that hardness is higher when the density increase is obtained through thermal annealing rather than through pressure-quenching. Molecular dynamics simulations reveal that this arises because pressure-quenching has a larger effect on medium-range order, while annealing has a larger effect on short-range structures (sharper bond angle distribution), which ultimately determine hardness according to bond constraint theory. Our work could open a new avenue towards industrially useful glasses that are identical in terms of composition and density, but with differences in thermodynamic, mechanical, and rheological properties due to unique structural characteristics.