Can I undo an overwrite after an FTP upload?
Yes. Before a Put overwrites a server file, FTP by Zaweba keeps the old version on your PC. Open history, compare it and press Restore to put it back.

Yes, as long as you made the upload with FTP by Zaweba. Before a Put overwrites a file on the server, the app keeps the server's previous version on your PC in local version history. Open the history window, compare the old version with the current one, and use Restore to bring it back. Then upload it again to put the server right.
Plain FTP has no undo of its own. Once a file is overwritten on the server, the old one is gone there. Local history is how this app covers that gap.
What is kept, and when
History is filled automatically. Before a local file is overwritten by Get, Get Newer or a save in the editor, or a server file is overwritten by Put, the previous version is kept on this PC. You don't press anything to make it happen.
The history window lists each kept version with when it was kept, its size and where it came from, so you can tell the copy from before this morning's upload from one kept last week.
Putting the old version back
Find the file in your local pane and open its history window.
Pick the version from just before the bad upload. The time it was kept is your best guide.
Use Compare with current to check. The diff shows changed lines, what's only on the left and only on the right, with Previous and Next change (Shift+F7 and F7) to step through, and options to ignore whitespace or show only changed lines. If you're not sure, Open a copy lets you look at the old version without changing anything.
When you're sure, press Restore. The current file is kept in history first, so restoring is itself reversible.
Now upload the restored file with Put. The server is back as it was.
Why it all happens on your PC
Nothing in history touches the server. That's deliberate. It works on any host, needs no extra software there and doesn't use your hosting space. It also means the restore is a two-step job: put the file right locally, then upload it.
Setting the limits
History takes room on your disk, so File > Options lets you set how many versions to keep per file, a total size cap and a maximum file size, plus Clear history. The defaults suit most sites. If you work with large files, check the maximum file size, because a file above it won't be kept.
Preventing the overwrite in the first place
FTP by Zaweba warns before a single-file Put or Get overwrites something if the server copy changed since you last downloaded, opened, listed or uploaded it, which usually means someone else edited it. The dialog lines up both sides' times and sizes. Taking a moment there often saves needing history at all.
Previews help too. Put Newer to Server, Put Recent to Server and Sync all show the list of files before anything is uploaded, so a stray file can be unticked.
And if the problem wasn't an overwrite but a delete, look in the server trash instead. Server deletes can go there, and the Trash window restores ticked items to their original location.