Delete and undo through Git
Weik.io 2026.2Remove a file and apply with --prune to delete what it described, and undo a change with git revert through the same pipeline. Product page · Video
Watch: Deleting and undoing through Git, 3:45
The video deletes an integration by removing it from the repository and undoes the delete with git revert.
On this page
In a repository, deleting something is a commit that removes its file. The next apply of the folder with --prune deletes it on the platform, and the pull request’s plan lists the deletion as would delete before anyone merges.
How prune works#
--prune finance deletes what earlier applies of the same folder, with the same --prune finance, put on the platform and the folder no longer has, whatever its kind:
- A deployment file removed from an environment’s folder undeploys the integration in that environment.
- An API deployment file removed undeploys the API version there.
- An integration directory removed from
shared/deletes the integration once no environment runs it, with its versions and its own values.
$ weikio diff -f ./finance/production --env production --prune finance
$ weikio apply -f ./finance/production --env production --prune finance -yThe name after --prune is the record of what the folder put there, one name for the repository in every job. So a plan you make on your own machine with --prune finance shows the same deletions the pipeline’s next apply makes.
What prune never touches#
Prune deletes only what the folder put there. It never deletes:
- another folder’s documents, or documents applied under another name,
- anything made by hand in the CLI or the admin UI, including a record deleted and made again by hand under the same name,
- values set with
weikio secret set, - subscriptions a consumer created,
- a project the folder no longer has, or an environment the job doesn’t name.
It never runs without the flag, and the first apply of a folder with --prune deletes nothing and says so. A folder you move or rename starts over the same way.
Remove an integration#
Remove an integration in one commit that deletes its directory from ./finance/shared and its deployment files from every environment’s folder. Each environment’s apply undeploys it, and the first apply of shared/ after no environment runs it deletes it. Until then the shared folder’s apply keeps it, with a warning that says where it still runs.
Everything in shared/ is read by every environment, so a file removed there is deleted for all of them at the devtest job, before production’s approval. The plan marks such a deletion with a warning.
What the integration stored, such as its run records, its channel’s events and its dead letters, stays in each environment until the environment’s retention removes it, 30 days by default.
Undo with git revert#
A change that went wrong is undone with git revert, merged through the same pull request and approval as any change:
$ git revert 4f2a9c1
$ git push origin HEAD:revert-promotionA reverted promotion moves the deployment file back to the version it had, and the apply deploys that version without a build, because it already exists. A reverted delete brings the files back, and the next apply creates the integration again and builds its versions from the directory. The new record has an ID of its own, and an integration’s own secret values are set again with weikio secret set.
In an incident#
An operator may run weikio rollback or weikio stop by hand to stop the damage first. The next apply from Git puts back the state the repository describes, so commit the fix afterwards. Until you do, weikio diff shows the difference as drift.