Editing Undoing-a-commit
From BRL-CAD
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
= Undoing an svn commit = | = Undoing an svn commit = | ||
− | Sometimes one may inadvertently commit a change that was not intended | + | Sometimes one may inadvertently commit a change that was not intended. For example: |
$ svn ci test_vls.c | $ svn ci test_vls.c | ||
− | + | ... revision: 9999 | |
− | |||
− | |||
− | We want to "uncommit" the change. | + | We want to "uncommit" the change. But if we don't want to lose the changes we made, we either need to copy the changed file(s) to an unversioned directory '''before''' we do the merge or save the differences '''before''' we commit the merged changes. |
− | + | First get the URL of the trunk (shortened example): | |
− | $ svn svn merge -r9999:9998 | + | $ svn info |
+ | Path: . | ||
+ | URL: https://brlcad/svnroot/trunk | ||
+ | Repository Root: https://brlcad/svnroot | ||
+ | Repository UUID: 2f96ce8b-6d43-0410-b8df-bffccc660ffb | ||
+ | Revision: 9999 | ||
+ | Node Kind: directory | ||
+ | Schedule: normal | ||
+ | Last Changed Author: tom | ||
+ | Last Changed Rev: 9999 | ||
+ | Last Changed Date: 2012-05-23 15:10:33 -0500 (Wed, 23 May 2012) | ||
+ | |||
+ | Save the changed file(s) if desired. | ||
+ | |||
+ | Do the merge: | ||
+ | |||
+ | $ svn svn merge -r9999:9998 https://brlcad/svnroot/trunk | ||
U test_vls.c | U test_vls.c | ||
− | + | Check that the trunk has changed to the state before the bad commit: | |
− | |||
$ svn diff | $ svn diff | ||
Line 25: | Line 38: | ||
Commit the change ('''caution''': this will undo local changes that were originally committed!): | Commit the change ('''caution''': this will undo local changes that were originally committed!): | ||
− | $ svn commit -m " | + | $ svn commit -m "Undoing change committed in r9999." |
Sending test_vls.c | Sending test_vls.c | ||
Transmitting file data . | Transmitting file data . | ||
Committed revision 10000. | Committed revision 10000. |