You can try going into Retroarch and setting the key assignments in there, but if that doesn’t work you might have to edit config files manually, as per this thread…
Instead of the above, it may be easier to download the latest version of RetroPie and do a fresh install.