I've done something stupid

I copied a bit of audio to add it to another track but ended up replacing the entire track. I undid the paste but now all the audio from the original track is gone. Is there a way to recover it?

How did you do that? Was it because you double-clicked in the track you were pasting into, so you selected all of it? In that case the selection is replaced, so what you wanted to do was single-click where you wanted to paste.

Also, please read the pink panel at the top of the page and give us the missing information.

Undoing the paste should have restored the original audio. I don’t know exactly what you did, but you can open View > History… then click on each project state that is available.