ID:2177097
 
(See the best response by Flame Guardian.)
So I was working on my map placed a few turfs down compiled then went afk. Came back to this error https://gyazo.com/df57fc1017c6c58f44119f5aa44168a9
I went to edit the map file with notepad to find out what it was and came across this https://gyazo.com/f36a8a733bb2e5c22e903465c056c6d1
The map was wiped..is there a way I could fix this or is it gone forever. Also is there a way I can avoid this issue in the future?

Best response
Always always always back up your sources. Work and sometimes full source codes can be lost if you neglect to do so.

I backup a new copy of my source after every work session and before updating to a new version of BYOND.

I also backup said sources on two separate hard drives once a week.

Perhaps someone else can enlighten you on how to fix your corrupted map file or if it's even corrupted at all. Otherwise, you could explore the option of using windows restore points to rewind your computer to a time that your map was intact. This option may not be worthwhile though if you don't have any recent restore points.

https://support.microsoft.com/en-us/help/17127/ windows-back-up-restore
Yeah I tried to go back to a restore point and found that the feature was turned off. Yeah I guess i'll just have to back my files up more often. Wish I knew what caused it though. Thanks for the help.
You could try to see if there is a shadow copy - sometimes that's on without backups. Go to the folder where the file was. Right click. Properties. There should be a "Previous Versions" tab. See if there's anything in there.
On top of what SSX said, I believe BYOND also sometimes just straight up makes backups for you. Like a backup folder in your project library.

I never understood how and when that happens but I'd take a look for it anyway. Once again, it'd be in the same folder as the map file and the folder would be labeled something like "backup".
Map backups are created when you try to load a map and it fails due to compilation issues.
I really recommend that you setup git or some other version control for your projects. Copying and pasting and making your own backups is messy and confusing. Look up git or subversion or perforce and use one of those.