How to revert/recover .m file to a previous version? (autosaved blank by mistake and xcode crashed – no Source Control, no Time Machine)

I’ve tried to search for the answer but I cannot precisely define the terms without falling under wrong threads all the time.

What happened:
Accidentally I’ve selected all the code inside a file.m and deleted it all.
It became a full blank document. When I pressed Ctrl+Z to UNDO it, the xcode crashed.

  • Jenkins build step fails when calling “npm” on mac-os-x Yosemite
  • git merge fails with “Untracked working tree file” on case change
  • SVN (Subversion) Problem “File is scheduled for addition, but is missing” - Using Versions
  • SSH hangs at “SSH2_MSG_SERVICE_ACCEPT received” or “SSH2_MSG_NEWKEYS received”
  • Jenkins Slave Doesn't Use Same Ruby Version As On Local Terminal
  • Trouble with Jenkins and Git
  • The problem:
    When I reopened the xcode (after the crash) , the file was still all blank (It was autosaved seconds before the crash as a blank document) – losing all my code. I could not use UNDO to rescue me on this because it autosaved and crash.

    What do I need:
    Is there a way to recover/revert my file to a previous state before this autosaving/crash?

    Extra information:
    Source Control: I can’t use it because the last “commit” was June 27.

    Time Machine: Don’t have external HD to use it. It is disabled.

    Updated 1: I’ve pressed the button “discard last change” and the file.m reverted to the file saved June 27.
    So, one more problem: Lose all the months of work up until now.

    Update 2: I’ve found the solution, and posted below. But I need to wait until tomorrow to accept it as answer.

    Update 3: I’ve reedited the text to clarify my problem.

  • How to suppress the editor for `git rebase --continue`?
  • How can I commit with no fast forward option (--no-ff) in SourceTree?
  • remove deleted files from git: Argument list too long
  • Git, XIBs, merging
  • Mac specific optimizations in ~/.gitconfig
  • Git Reverting a big PUSHed file
  • One Solution collect form web for “How to revert/recover .m file to a previous version? (autosaved blank by mistake and xcode crashed – no Source Control, no Time Machine)”

    Oh! I fix it.
    I’ve opened the file.m with TextEdit.
    Then I browse to:
    File > Revert To> Browse All Versions

    It led me to a place with all saved versions of the file, where I could search with a timeline the exact moment I need.

    enter image description here

    I’ve find the version previous to the blank/crash moment, and copied the text, paste it at file.m on xcode( also saved, commit it to source control for safety) and everything is ok now. I could recover all my code again.

    Git Baby is a git and github fan, let's start git clone.