Javascript replacing document

I have been working on a document for several days, but I have come to load it up today and the entire document has been replaced by over 50 pages of JavaScript code, no document anywhere to be seen other than that. Why is this and how can I regain the document itself?

i upvoted your question, Please edit your question and upload the document with the JavaScript code here.