Horia Dragomir
Horia Dragomir

Reputation: 21

How do I regain my source after gcc -o mistake order

I run "gcc -o program.c program" instead of "gcc program.c -o program" by mistake and now I lost my source (program.c). Is there any solution to regain my source or it is definitely lost?

Upvotes: 2

Views: 75

Answers (1)

Bart Friederichs
Bart Friederichs

Reputation: 33533

No. It is lost, the OS overwrote your source code file.

Unless you have a backup, it is gone.

To prevent that from happening in the future, you could use make:

~$ make program

Upvotes: 2

Related Questions