Safe Mode is a configuration fail safe for Mikrotik routers. If enabled and you make a change that disconnects your session to the router, whatever changes were made will be rolled back, which should let you get back in the router.
If your in WinBox you can hit the Safe Mode button at the top left
If your in a telnet or ssh session just hit
ctrl + x
You should see the following to let you know that safe mode is active
[Safe Mode taken]
Hit ctrl + x again to release Safe Mode