A. After losing your layout, go to the settings menu and reconfigure your controls. Save the new layout to ensure it is not lost again.
B. Take screenshots of your custom layout settings before making changes, so you can easily restore them if needed.