version 1.8, 2005/07/02 00:35:25 |
version 1.9, 2005/07/12 20:51:57 |
|
|
|
|
<a name="revert"></a> |
<a name="revert"></a> |
<h4>Reverting a change</h4> |
<h4>Reverting a change</h4> |
If you have committed a file in a wrong directory, or which has |
If you have committed a file and you discover that your commit breaks |
problems, you have to revert the commit as soon as possible. To do |
something, you have to revert the commit as soon as possible. Assume the |
such thing with <i>badfile</i>, you can do: |
problem lays in a file called <i>somefile</i>. Follow the procedure |
|
below to revert it to an unbroken revision: |
|
|
<pre> |
<pre> |
$ cvs log badfile |
$ cvs log somefile |
</pre> |
</pre> |
|
|
<p> |
<p> |
|
|
checkout the previous revision and commit it to fix the issue. |
checkout the previous revision and commit it to fix the issue. |
|
|
<pre> |
<pre> |
$ rm badfile |
$ cvs update -A somefile |
$ cvs co -r1.191 badfile |
$ rm somefile |
|
$ cvs update -p -r1.191 somefile > somefile |
</pre> |
</pre> |
|
|
<p> |
<p> |
<i>1.191</i> is just the previous revision before <i>1.192</i>. Now, you |
<i>1.191</i> is indeed the previous revision. It is now in your working |
have it in your working copy and you can commit to restore things. |
copy. You should commit it to restore the file to a working state: |
|
|
<pre> |
<pre> |
$ cvs commit -m "restoring previous version" badfile |
$ cvs commit -m "restoring previous version" somefile |
|
</pre> |
|
|
|
<a name="wrongdir"></a> |
|
<h4>Committing in a bad directory</h4> |
|
If you have committed a file in a bad directory, you have to fix things |
|
by moving it to the right directory as soon as possible. Assume you have |
|
committed <i>somefile</i> to <i>baddir</i> while it should really go |
|
into <i>gooddir</i>. Here is the procedure to correct your mistake: |
|
|
|
<pre> |
|
$ pwd |
|
...devel/openbsd/steelix-www/.../baddir |
|
$ cvs remove somefile |
|
$ mv somefile path/to/gooddir |
|
$ cd path/to/gooddir |
|
$ pwd |
|
...devel/openbsd/steelix-www/.../gooddir |
|
$ cvs add somefile |
|
$ cvs commit -m "move file to the right location" somefile |
</pre> |
</pre> |
|
|
<h3><font color="#0000e0"><a name="Guidelines">Translation |
<h3><font color="#0000e0"><a name="Guidelines">Translation |