Discard local edits
discard_local_changesDiscard all local edits, new files, and unpushed commits to reset a project clone to its current Overleaf version, useful when conflicts block pushing.
Instructions
Permanently throw away every local edit, new file and unpushed commit in one project's clone, fetching Overleaf first so the clone ends up matching its current version. The discarded work cannot be recovered from this server. Call show_diff first, and only call this once the user has said the work should be abandoned. Its main use is after push_changes refuses a conflicting change: the clone cannot be pushed again until the conflicting local commits are either published or discarded here. Only the chosen project is reset; pending work in other projects is untouched. Returns how many edited files and unpushed commits were discarded, or that there was nothing to discard.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | Which project to use: its Overleaf address, its 24-character id, or a registered project name. Omit to use the default project. |