Make sure you’re in the installation directory for the Raspberry Pi software. Mine is installed at /home/pi/Retropie-Setup.
git remote set-branches origin '*'
git checkout master
Then run the Retropie installer script:
Choose ‘Update.’ Follow the prompts. This will go out and grab the updated code. I was on 4.4.1, and currently upgrading to 4.5.x.
Credit to https://retropie.org.uk/forum/topic/24395/back-to-master-branch for the details.