Any way to restore a program to how it was before you screwed it up?

Okay, I'm in a total panic. I was adding comments to a complete, working program and my pinky hit either the home, insert, or delete key (I think) and it said in red something like hit ! to override these characters it had inserted. I'm not exactly sure what I hit. So when I tried to compile it again to make sure I didn't screw it up, it got these weird errors that look like this:
1
2
3
4
5
6
7
8
9
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../lib64/crt1.o: In function `_start':

date.cpp:(.text+0xd1): undefined reference to `std::cout'
date.cpp:(.text+0xd6): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
date.cpp:(.text+0xe3): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
date.cpp:(.text+0xee): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
date.cpp:(.text+0xfb): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'
date.cpp:(.text+0x105): undefined reference to `std::basic_ostream<char, std::char_traits<char> >::operator<<(int)'
date.cpp:(.text+0x10a): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<c 

There are a ton of errors just like that! Any idea what I may have done? Is there any way to fix this? Thanks!
You could try to undo (Ctrl-Z) many times and see if you get your old code back.

Looking at your error message it looks like you are missing to include <iostream>
Control Z? Okay, I'll try that. All 3 files had compiled perfectly, output was perfect and I was just adding comments when... :( Thanks for replying. I just tried to copy/paste the code into word to start the screwed up program again, but nothing in the {} copied. Weird!
Fixed! Thank you!
And at some (near) point in the future, consider using a CVS.
Topic archived. No new replies allowed.