Search code examples
phpsvnphpstormhistory

How to recover SVN history of a file which is replaced with another one?


I have searched for this issue and find this question but I can't find any proper solution. I am working on a project which is under SVN using PhpStorm. I replaced a file with another one as follows:

  • make a copy of the file: file.php, file1.php;
  • renamed files: file.php -> file0.php, file1.php -> file.php;
  • commit file.php (the new file);

Now I can not see the history before this file replacement.

What is the way to recover the file history in the SVN or revert to the previous state?


Solution

  • I have found one possible solution to the issue:

    If the project is running in a group, then we need to find someone in the group who has not updated the lost file, therefore, has an un-updated version of the lost file.

    This un-updated file contains all the history of the main file which we have lost its SVN history.

    So, we can commit this un-updated file with new codes and all the history will be in the SVN again.