Can I get back a file that an agent overwrote?

Usually yes.

When write_file, write_files, edit_file or edit_files overwrite a file, SyncNow keeps the previous content on its own server, up to 20 versions per file, and an agent can put one back with restore_version.

Ask your agent to list the versions of that path with file_versions, read the one you want (passing its version only reads it and changes nothing), and then restore it. The restore is a normal checked write: it needs the agent's open session and a baseline, it checks the stored bytes against their recorded hash and size, it lints a .php file, and it keeps what it replaces, so a wrong restore can be undone too.

There are limits: no version over 2 MB, no binary or media files, and for files that look like configuration only the fact of the change and its hashes are recorded, so credentials are not stored. Moves, timestamp touches and edit_files in all-or-nothing mode keep nothing (a copy keeps the file it overwrites, an append or a number bump the content before it), and so does a delete unless the agent passes keep_version to delete_path (since version 13.2.49.79), versions are tied to the path (a renamed file starts a new list), and they are not part of your hosting's own backup. A scheduled cleanup on the SyncNow server can also remove older copies, so the list file_versions returns is what still exists.


Can two agents edit the same file at the same time?
How do I see who changed a file and when?
Getting Started
Projects and the Workspace
Agents and Work Sessions
Planning
Rules
Activity, History and Insights
Managers and Teamwork
Connections, Credentials and Security
Source, Safe Editing and Recovery
Updates, Reports and Troubleshooting