Scanning probe microscopy has become a powerful tool to detect structural changes in small clusters of atoms. Herein, we use an atomic force microscope to measure the length of gold nanowire structures during extension and compression cycles. We have found that nanowires elongate under force in quantized steps of up to three integer multiples of 1.76 A and that they shorten spontaneously in steps of 1.52 A. Our results can be explained by the sliding of crystal planes within the gold nanowires creating stacking faults that change the local structure from face-centered cubic to hexagonal close packed. Our data also show that there can be up to three simultaneous slip events, in good agreement with the tetrahedral arrangement of slip planes in a gold crystal. These experiments provide direct evidence for the mechanism underlying the plastic deformation of a nanowire. A similar approach can be used to examine the atomic events underlying the plastic failure of other metals and their alloys.