I've recently discovered `git switch -` and `git merge -`. It switches to the previous branch you were on or merges the previous branch you were own.
No need to know the name.
So if I need to pull updates on the previous branch I was on and merge them into my current branch, I can just:
git switch -
git pull
git switch -
git merge -