The pencil tool is a DESTRUCTIVE editing tool.
It directly writes into the wave file.
It is recommended that you first make a COPY of the audio file you are about to edit with the pencil tool. And keep the original intact.
It's right in the reference manual:
page 648 "Waveform Repair with the Pencil Tool"
"On audio tracks, the Pencil tool lets you destructively “redraw” waveform data. This tool is most commonly used to repair a pop or click in an audio file. A pop or click appears as a sudden sharp spike in a waveform. This tool only becomes active when the Edit window is zoomed in to the sample level. Although you can Undo a Pencil tool edit, it is recommended that you create a backup copy of the target audio before using the Pencil tool. You can do this by using the AudioSuite Duplicate plug-in.
The Pencil tool is a destructive editing tool that permanently modifies the audio file on disk and should be used with caution. ![devil :devil:](./images/smilies/icon_devil2.gif)
Howling at the neighbors. Hoping they have more mic cables.