views:

587

answers:

3

I was trying to tar a file and ended up overwriting it. I was working in Xcode and I'm wondering if there is a way for me to recover the overwritten file.

+2  A: 

Unless you saved it somewhere else, its unlikely. sorry

gbrandt
A: 

Yes, from your backups which, of course, you do regularly and frequently, right?

On second thoughts, you probably don't, so you're fresh out of luck.

I'd look on this as an opportunity to change your backup practices :-).

paxdiablo
Jeez... kick him while he's down, why dontcha? :P
Sean Bright
The best thing about kicking people when they're down is that you can usually get away before they get up again. The best thing about kicking people when you're climbing the corporate ladder is that you can kick them on the way down as well :-).
paxdiablo
What if the tarring was part of his backup process?
Andrew Grimm
@AndrewG, I can't tell whether you're trying to be funny or not :-) Most people would keep their previous backups well away from the computer being backed up. They certainly would stage their backups by giving them filenames with the date in them, otherwise massive failure during the backup process would result in backup and data being lost.
paxdiablo
A: 

If you mean that you added the same file twice in a tar archive, chances are that you can recover it: tar never overwrite, it appends. And when extracting it extract both which may result in an overwrite.

If you mean that you extracted a file from a tar archive and overwrote another in the process, unfortunately your only chance is backups. Maybe Time Machine is up on your Mac or you are using a SCM for your developer tasks.

mouviciel