How to reset a project's code and data


To reset a project entirely to a new code base.


You will need:

  • A working project
  • Administrator access to it
  • Git and SSH configured and accessible
  • Your default/production git branch is named main


Normally the easiest way to “start fresh” with a project on is to create a new project and optionally delete the old one. However, there are some cases where that may not be viable:

  • When using a trial project, deleting the project created with the trial will also delete the trial, even if the trial period has not expired.
  • You may want to retain non-code configuration on the project (users, access control, etc.) but still reset all code and data on the project.

These steps will “reset” a project to a fresh state.

Warning: By design, these instructions will result in code and data loss. Do not proceed unless code and data loss is really what you want to do.


1. Remove all services and application data

Edit the services.yaml file and remove all lines. Just leave it as an empty file.

Then update your file. Remove the relationships block, all mount declarations and change the name key to any new value.

Optionally you may remove the hooks section to make the deploy a bit faster but that is not necessary.

If you have multiple files, do the same for all of them.

Commit these changes and git push to the production branch. The environment will rebuild with no services (and thus deleting all of the previously-specified services) and with a blank application container.

Additionally, delete any non-main branches in Git as they will not work correctly after this process is complete.

2. Select a new code base to deploy

If you have an existing Git repository you wish to deploy, ensure it has the appropriate configuration files.

If you would like to use a one of’s pre-made templates, git clone the appropriate repository from GitHub to your local computer.

Now reset the Git history in the repository. cd into the directory you just cloned, then run:

$ rm -rf .git
git init
git add .
git commit -m "Add template."

3. Force push to the project

Add a Git remote for the project to the local Git repository you just created. You can find the Git URL to use in the Web Console by going to the production environment and selecting the “Git” dropdown. Just copy the remote URL itself, not the full command.

Add that remote to the project (using the Git URL you just copied):

git remote add platform

Then “Force push” to the main branch of the project:

git push --force -u platform main

That will completely overwrite the main branch on with the code in your new repository, and set your local branch to track the project’s main branch so you don’t need to specify it in the future.

The new code will build and deploy a new main environment with the configuration in Git.


The project will now have a fresh Git history with new code, and completely empty services based on what was defined in the new code base. Any users or environment variables that had been defined previously, however, will remain intact.