Archive - Originally posted on "The Horse's Mouth" - 2009-10-27 23:41:30 - Graham Ellis
You're using the Linux command line interface, you get distracted, and you type in ci. Oops - before you know it, you've lost your file ... at least it has disappeared from where you expected it to be:
[root@holt conf]# ci server.xml
server.xml,v <-- server.xml
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
>>
initial revision: 1.1
done
[root@holt conf]#
What's happened IS recoverable. You have "Checked In" your file to the source code control system (have you come across SCCS and RCS?), and there's now a version controlled system with ,v on the end of the filename that has replaced your original.
To recover a copy of the original, you can "Check Out" your file with the co command:
You may need to check the permissions on the file, and if you have specific line formats that are taken as revision control headers, they may have been updated but ... you have not lost your file!
RCS, SCCS, SubVersion, CVS and others are all revision control systems which allow you to keep numerous versions of a file, and to go back to old versions too. Checking out a file for edit allows it to be locked so that in a multi-developer environment, you have a mechanism available that avoid two people editing the same file at the same time ... with the edits of one being over-ridden by the other.