Whenever you work on a network device there is a chance that you execute the wrong command and you lose connection. This can be bad, mostly if you are far away from the device or many people are affected.
In situations like this is when safe mode can be a lifesaver. When safe mode is enabled changes take affect but are not saved. If connection is dropped unexpectedly all changes are going to be reverted. When? Timeout is 9 minutes. If you are logged in via web or Winbox you’ll find the safe mode button on bottom left, if you use ssh press CTRL+X to enable or disable safe mode. When you exit safe mode changes are saved. To exit click again the button; via ssh you exit with /quit – changes are also saved, with CTRL+D they are not.
Also good to know that in case another user logs in while the device is in safe mode they are prompted about safe mode. When in safe mode on web/Winbox the button stays pushed, via ssh there is <SAFE> text before each line. In history the are also flagged with F – floating-undo.
[user1@mikrotik] <SAFE> ip address print
Flags: X - disabled, I - invalid, D - dynamic
# ADDRESS NETWORK INTERFACE
0 ;;; LAN
10.10.10.1/24 10.10.10.0 eth2-master
1 ;;; IOT
192.168.1.1/24 192.168.1.0 bridge-IOT
3 D xxx.xxx.xxx.xxx/24 xxx.xxx.xxx.xxx eth1
[Safe Mode released]
You can find more details in the official documentation: https://wiki.mikrotik.com/wiki/Manual:Console#Safe_Mode