Folder changed into document A folder and all it's contents have changed into an extensionless document. When I open the file in Sublime Text I get 100,000+ lines of text like: 0403 0000 46aa ee00 0000 0000 1800 0000. This is on an HFS+ boot volume.

Google Drive shows the history of this as being a document as of the initial upload. So it should be ruled out as the culprit.

My Time Machine backup on a Time Capsule only goes back to the beginning of August, which shows the folder as a file.

How do I change this document back into a folder?



cd &lt;folder&gt; returns Not a directory

stat &lt;folder&gt; returns 16777218 1139857 -rw------- 1 &lt;my username&gt; &lt;company name&gt;\Domain Users 0 1800948 "Aug 21 09:11:51 2014" "Apr 16 11:04:43 2014" "May  1 14:00:13 2014" "Apr 16 11:04:43 2014" 4096 3520 0 &lt;folder&gt;

tar -xzf &lt;folder&gt; returns

tar: Unrecognized archive format
 tar: Error exit delayed from previous errors.
There are a bunch of posts online from users who have run into this issue. All of them end with the same answer: "I hope you have a backup." 

I have spoken to multiple people who have worked with Unix/Linux for a long, long time. The general consensus is that 


there is no way to just "turn a folder into a file"  
there is no recovering from whatever you have done without restoring the
directory from a backup


They believe that some application has deleted the directory unintentionally and replaced it with a file. I have looked online for a way to manually set the d bit of the file you are speaking of but there seems to be no way of achieving this.

So, my answer is to restore the directory from a Time Machine backup (you hinted that you already had a backup - use it).