php - 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?
Answer
Solution:
I've just executed all the steps you've mentioned and I see all the history when I runsvn log file.php
orsvn log file0.php
. The problem is that you most likely did not use the SVN commands or you removed or replaced the files without using the SVN client.
Use the correctsvn copy
andsvn rename
commands and you will see all the history before your copy or rename operations.
Answer
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.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: call to a member function getclientoriginalname() on null
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.