Do what he said, carve a unique string onto an object (like “Mxyzptlk”), drop it on the ground, and save/exit.
Then do a file search for that string, it’ll only appear in the file where the map you’re standing on is saved. The file will be named something like “123.456.789.map”.
Keep the directory that file is in and delete the others. If you want nearby basements, labs and such to stick around, save any folders that have the same name except the last digit. (e.g. if you’re in 0.4.0, save 0.4.-1, o.4.-2, etc…)
This will reset the world except for the overmap you’re in. If you travel back to old locations, there will be buildings in the same places, but the buildings will be new. Monsters may or may not generate properly on old overmaps after you do this.
If you want to wipe everything, you’ll need to figure out which overmap you’re in and delete all the other ones too.
The overmap file is stored in saves/worldname/o.x.y if it’s the starting overmap it’s o.0.0, but if you’ve moved sufficiently far you won’t be in that overmap anymore.