We report an atomic force microscopy (AFM) based nanoshaving approach on graphite, covalently functionalized using diazonium chemistry. Upon removal of the covalently bound layer on top of graphite, two different types of breakdown products are observed under ambient conditions, depending on the diazonium salt used. Due to the nanoshaving procedure, the strained graphite lattice is restored to its pristine sp 2 nature, as confirmed by Raman microscopy. A general strategy for nanoshaving is provided under ambient and liquid conditions, optimizing the key parameters, and aimed toward retaining the structural integrity of the AFM probe, allowing subsequent imaging. Finally, the self-assembly of n-pentacontane was studied inside such in situ nanoshaved areas to illustrate the potential of AFM based nanoshaving to investigate self-assembly processes occurring under 2D lateral confinement.