当前位置: > Linux服务器 > SVN >

svn文件版本还原

时间:2015-02-08 00:24来源:linux.it.net.cn 作者:IT
1、还原本地开发环境文件到某个版本
查看文件修改记录:svn log file_name
该目录下文件还原到某一版本(存在该版本的):svn up -r 版本号
还原指定文件到某一版本:svn up -r 版本号 文件名称
例如:
(1)zhanghuijun@campostdev:~/cpst/campost/mlres/forms/disp> svn log opn_dom_item_modify.mfrm
------------------------------------------------------------------------
r5431 | huaruoxu | 2013-12-07 16:40:16 +0100 (Sat, 07 Dec 2013) | 1 line




------------------------------------------------------------------------
r4413 | lihaiquan | 2013-06-05 05:47:24 +0100 (Wed, 05 Jun 2013) | 2 lines


Change the TextBox length for Bag and Item from 20 to 128


------------------------------------------------------------------------
r3500 | wuchang | 2012-12-13 10:14:22 +0100 (Thu, 13 Dec 2012) | 1 line


wuchang


(2)zhanghuijun@campostdev:~/cpst/campost/mlres/forms/disp> svn update -r 4413 opn_dom_item_modify.mfrm
Updating 'opn_dom_item_modify.mfrm':
U    opn_dom_item_modify.mfrm
Updated to revision 4413.
zhanghuijun@campostdev:~/cpst/campost/mlres/forms/disp> 
zhanghuijun@campostdev:~/cpst/campost/mlres/forms/disp> svn log opn_dom_item_modify.mfrm
------------------------------------------------------------------------
r4413 | lihaiquan | 2013-06-05 05:47:24 +0100 (Wed, 05 Jun 2013) | 2 lines


Change the TextBox length for Bag and Item from 20 to 128


------------------------------------------------------------------------
r3500 | wuchang | 2012-12-13 10:14:22 +0100 (Thu, 13 Dec 2012) | 1 line


wuchang


或者提前一个版本号即可:
svn update -r 5430 opn_dom_item_modify.mfrm


2、还原SVN库环境文件到某个版本:
(1)更新到最新:svn update
(2)查看文件修改记录:svn log file_name
(3)使用旧版本文件:svn merge -r 新修订版序号:旧修订版序号 file_name
(4)提交:svn commt file_name
例如:
(1)zhanghuijun@campostdev:~/cpst/campost/mlres/forms/disp> svn update
Updating '.':
U    opn_dom_item_modify.mfrm
Updated to revision 5434.
(2)zhanghuijun@campostdev:~/cpst/campost/mlres/forms/disp> svn log opn_dom_item_modify.mfrm
------------------------------------------------------------------------
r5431 | huaruoxu | 2013-12-07 16:40:16 +0100 (Sat, 07 Dec 2013) | 1 line




------------------------------------------------------------------------
r4413 | lihaiquan | 2013-06-05 05:47:24 +0100 (Wed, 05 Jun 2013) | 2 lines
(3)zhanghuijun@campostdev:~/cpst/campost/mlres/forms/disp> svn merge -r 5431:5430 opn_dom_item_modify.mfrm
--- Reverse-merging r5431 into 'opn_dom_item_modify.mfrm':
U    opn_dom_item_modify.mfrm
--- Recording mergeinfo for reverse merge of r5431 into 'opn_dom_item_modify.mfrm':
 U   opn_dom_item_modify.mfrm
--- Eliding mergeinfo from 'opn_dom_item_modify.mfrm':
 U   opn_dom_item_modify.mfrm
(4)zhanghuijun@campostdev:~/cpst/campost/mlres/forms/disp> svn commit   (责任编辑:IT)
------分隔线----------------------------