Skip to main content

Revert master / accidental master merge / deploy broke something

or - when shit hits the fan

You accidentally merged something to master​

  1. Go to https://gitlab.com/powr/powr/-/jobs and cancel your deploy.
  2. Go to engineering channel and post "DO NOT MERGE TO MASTER, reverting an accidental merge".
  3. Go back to the MR you just merged, click the revert button, create a new MR and then merge it an addition to the title [ci skip]. This will ensure we do not trigger another deploy.
  4. Go to engineering channel and post "Feel free to merge to master, crisis averted".

To revert when there is more than one merge commit (another push was sent to prod and both need to be reverted)​

  1. Make a new local branch off of master
  2. Look at git log and find the Merge commits in the list, note the SHA's and make sure you remember the order, you will need to revert them in reverse order (so last one first)
  3. Use this command with the correct SHA for each commit you need to revert: git revert -m 1 3307058d4466d39c42ed6ba3cee94f0f70e6c0fe
  4. Now push your branch to gitlab and make a merge request
  5. Make sure to [ci skip] the MR, get 2 reviewers, then merge the MR and alert the engineering channel that prod is open to merging again.