Is there a way to recover from an accidental “svn revert”?

前端 未结 10 1892
青春惊慌失措
青春惊慌失措 2020-12-04 20:35

I managed to shoot myself in the foot this morning by doing the following:

  1. Started working on a change to my project
  2. Made a bunch of edits to a bunch
10条回答
  •  长情又很酷
    2020-12-04 21:24

    No, SVN does not keep a log or backup (although there is a solution for TortoiseSVN noted in the other answers).

    But in case someone is browsing the answers and did not notice this comment in the OP's question:

    "Fortunately in this case I had done an "svn diff > temp.txt" before leaving work on Friday, and the temp.txt file was still on my hard drive, so I was able to feed that file into "patch" and recover my lost changes."

    I imagine it is a common paradigm to do 'svn diff' BEFORE you do an 'svn revert'. If you get in the habit of doing this, even if the diff is just echoed to the terminal, you've at least got one possible avenue to recover your lost changes.

提交回复
热议问题