问题
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.
回答1:
Unless you saved it somewhere else, its unlikely. sorry
回答2:
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 :-).
回答3:
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.
来源:https://stackoverflow.com/questions/535508/overwritten-file-with-tar