2011-10-21 9 views
2

私はenvからたくさんのファイルを削除し、変更をコミットしました。 もちろん、私は今それらのうちの1つを戻したい。私はsvnファイルの削除をコミットしましたが、今すぐ戻したいです

改訂版からONEファイルを取り戻す最も良い方法は何ですか?

パッケージのビュー履歴(ファイルはJavaファイル)からファイルを取得しましたが、コピーと貼り付けが不十分な状態に戻す方法はありません。 Eclipseの3.7.0

は、それがアントニオ・ペレスとqor72ソリューションのように見えます

両方の目標を達成する1.6

UPDATEをSubclipseの。アントニオは日食で行うことができますが、回帰の数は大きくなる可能性があります。また、コミットしている1つの要求が変更をマージします。

私はqor72の溶液が好きです。このシナリオでコピーにアクセスするには:

  1. 履歴を見て、削除されたファイルを見つけます。
  2. ファイル名を右クリックし、コピーを選択します。
  3. 元のディレクトリを選択します。
  4. OKです。
+0

それを取り戻すために次の手順に従ってくださいすることができますか? – JJJ

+1

コピー&ペーストの場合、私はsvnがそれらを同じファイルではなく2つの異なるファイルとして扱うことを前提としています。これは、2つのブランチを結合するマージで問題を引き起こす可能性があります。同じファイルであることがわかっている場合、マージ時にツリーの競合が発生します。 – Aaron

+0

@アーロン:私が私の答えで言うように進めば、それは問題ではありません。 –

答えて

1

は、たとえば、ファイルper the SVN documentation ressurrectです:次に

$ svn copy ^/calc/trunk/[email protected] ./real.c 

再度追加/コミットし、あなたが行くオフ。

+0

+1非常にシンプルでエレガントです。 –

1

おそらくサブクラスのクライアントは、簡単な方法で行うことができます。しかし、コマンドラインクライアントに試してみたいですか?

$ cd <working_copy_path> 
$ svn merge repo_url[@M] repo_url[@M-1] 

Mは、削除したファイルをコミットしたリビジョンです。そして、あなたが削除したすべてのファイルを作業コピーの追加ファイルとして取り戻す必要があります。次に

$ svn commit <your_file_to_be_recovered> 
$ svn revert (to remove the rest of added file that you don't need back) 

Further info on the svn merge commandです。私が過去にやっていること

0

あなたが唯一のコピーと間違って何、一つのファイルを必要として貼り付ける場合は

1. Identify the folder in the project which contained the deleted files. 

2. Right click the folder, select Team -> Merge 

Within Merge Pop up Window 

3. On the URL tab, Browse and select the "repository resource to merge with" i.e the same folder in the repository. 

4. Select Revisions radio button, 

5. Click Browse button to select revisions. 

6. Select the revisions which you want to be restored (select the revision wherein you deleted the files/folders) 

7. Enable Reversed merge. 

8. Click Preview and check that it shows an entry for the file/folder which you plan to restore. 

9. Click OK 

10. Eclipse now switches to SVN Merge and with the Synchronize view. 

11. In the Synchronize view, right click the files you want and select Accept 

12. In the Synchronize view, use the Synchronize SVN icon to switch from SVN Merge to SVN, where you can see the restored file as an outgoing change. 

13. Right click the file -> Team -> commit to check in the file again to the repository. 
関連する問題