I accidentally deleted one of my source files from on a Mac using
rm. I could rewrite it - its not worth buying a program to recover this one file.
But, is there a free alternative that could restore my file?
Questions on Super User are expected to relate to computer software or computer hardware within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.
As Mac OS is more or less a normal UNIX, you can follow these instructions. But I wouldn't go into single user mode, as I don't know how Mac OS behaves here.
Or try Data Rescue. I read somewhere that one can recover one file at a time with the demo version.
Besides Time Machine, you should also consider to use a version control system like Git which adds a lot more benefits than just "recover" accidentally deleted files.
I would comment but I can't. Did you try using the disk device instead of the partition? I think that should work.
Boomerang allows a free trial - might be enough to get a small file back.
For the future Time Machine!