how to retrieve original contents of a modified file (modified using vi)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to retrieve original contents of a modified file (modified using vi)
# 1  
Old 05-30-2007
how to retrieve original contents of a modified file (modified using vi)

Made changes to a file using vi editor and saved those changes

now realised that the changes are not required

How can I get the previous version of the file.i.e the one which was there on which I had made changes
# 2  
Old 05-30-2007
Not much solace here, http://osr507doc.sco.com/en/OSUserG/...ted_files.html

You could also consider using SCCS.
# 3  
Old 05-31-2007
There probably is no need to make this statement but it can't be stressed enough. Back up any files that you intend on editing no matter how little of a change you plan to make.
Easiest way to do this is make a copy of the file and append the date, time, or relevant note to the end of the file name if you need to ever go back to the original. Smilie
# 4  
Old 05-31-2007
If it was in cvs...

Code:
rm file-with-bad-change
cvs update

Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Is original file modified when pigz is interrupted?

I had to stop a pigz (parallel gzip) compression before it completed. Is the original uncompressed file changed/corrupted? I was under the impression that the original file is not changed during compression, though it is deleted if the compression is successful. (1 Reply)
Discussion started by: colin123
1 Replies

2. UNIX for Advanced & Expert Users

Who has modified a file - History?

Hello, I'd want to know who and what time has modified a file in unix (history). I'd like to know all people who has modified a file. Thanks in advance (6 Replies)
Discussion started by: nurinolo
6 Replies

3. UNIX for Dummies Questions & Answers

The original AF counter that has yet to be modified.

Hi guys... This was my original attempt at the AF Frequency Counter for the AudioScope.sh project... #!/bin/bash # Set the startup values... data="?" freq=0 number="" subscript=0 waveform=0 # An initial screen... clear printf "\nA simple 50 Hz to 3500 Hz audio frequency... (2 Replies)
Discussion started by: wisecracker
2 Replies

4. Shell Programming and Scripting

How to find a file modified more than once

Hi All, How to find a file modified more than once.... Thanks in advance (2 Replies)
Discussion started by: kmsekhar
2 Replies

5. Shell Programming and Scripting

How long since file has been modified

how can I find out if a file has been modified less than 24hrs ago (3 Replies)
Discussion started by: BeefStu
3 Replies

6. Shell Programming and Scripting

How to get a filename modified by attaching modified timestamp

Hi, I want to modify a filename in AIX by attaching the last modified timestamp. I want the timestamp completely in numerical format (eg:200905081210. yr-2009, mnth - 05, date -08, hr - 12, mins - 10). For example if the filename is a.log and it was modified on April 6th 2008 at 21.00. I... (16 Replies)
Discussion started by: Ruks
16 Replies

7. UNIX for Dummies Questions & Answers

who modified my file!!

Hi EVERYONE!!... Just a simple (yet critical from my perspective) doubt... I would like to know who had edited my file.. when I use ls -l command, I see my ID.. but when I edit using some other ID, I had expected that ID to be shown.. but still ls -l shows my ID only.. So, is there any... (4 Replies)
Discussion started by: mohanprabu
4 Replies

8. Shell Programming and Scripting

Check if file modified

Hi, I have a monitoring script that I run, and I would like to automate checking if specific parameter file is modified during the last day or two. How do I do that? (1 Reply)
Discussion started by: nimo
1 Replies

9. Programming

File last modified

I cannot read the last moment the file was modified - it returns "Most recent access" instead: code: </td> <th><?FILE *fatr=fopen(iindname.c_str(), "r"); if(fatr){ struct stat statbuf; fstat(fileno(fatr), &statbuf); fclose(fatr); ?> ... (4 Replies)
Discussion started by: szzz
4 Replies

10. UNIX for Dummies Questions & Answers

How do I get the last modified date of a file?

I am trying to load a group of files and their last dates modified into a text file that will in turn be used with SQL*Loader to load these files into Oracle. I am using a *.ksh script. I am getting the name of the file in by using the following: for file_ext in 'cat loaddir.ext'; do find... (2 Replies)
Discussion started by: akpopa
2 Replies
Login or Register to Ask a Question