I have a situation, a colleage of mine overwrote PHP files that I've made changes to , is it possible to roll back a file to a previous working version using the command line. No svn repositories are available and also not any backups.
|
I'm sorry to say that if you didn't make any backups, you're almost certainly SOL here, especially from the command line. Unlinking (deleting) a file can sometimes leave the data recoverable as long as nothing else grabs that particular inode; editing a file overwrites the data. If your colleague still has the editor he was working in open and its undo buffer is long enough, that might be a way to recover the original, but beyond that I'm afraid you're sunk. Sorry. |
|||||||
|
|
Assuming you're using ext3, it might be possible to recover it if the replacement file was created as another inode (instead of overwriting the existing file), by using |
|||
|
|
Usually you would have a tmp file created which begin with |
|||
|
|