Please add more info about your system, as detailed in https://retropie.org.uk/forum/topic/3/read-this-first.
Changes in RetroArch's configuration are not saved automatically, you need to either save a configuration override (for the Core used or for the Game) or - if you want to change an option globally - use the RetroArch entry in the RetroPie system and save explicitly the configuration.