Dariusz on Software Quality

09/06/2010

Subversion: How To Revert Single Commit

Filed under: en — Tags: , — dariusz.cieslak @

Let’s say you tracked someone broke HEAD of trunk and you want to reverse that single commit from main branch. Subversion makes very handy syntax for reverse merges:

svn merge -c -19203 https://REPO_URL

In example above you do reverse merge of 19203 revision (note “-” sign before revision number). After that merge:

  • Inspect if workspace compiles without errors
  • If it’s OK: commit local changeset
  • Notify 19203 committer about the change

In order to fix broken commit original author should do the opposite:

svn merge -c 19203 https://REPO_URL

(note there’s no “-” before revision number). Then:

  • Correct changeset and test if workspace is not broken
  • If it’s OK: commit local changeset (it will be nice to show original revision number in a comment)

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress