by Tim Hunt.
The quickest way to get your messed up MOODLE_23_STABLE branch back to origin/MOODLE_23_STABLE is (assuming that you are on your MOODLE_23_STABLE branch) to do
git reset --hard origin/MOODLE_23_STABLE
Note that that will remove any uncomitted changes that you have, so you should probably start with
git status
If there are changes you want to keep, then do
git stash
git reset --hard origin/MOODLE_23_STABLE
git stash pop