Is it possible to selectively apply changes from one branch to another with Git?
More specifically, I use a public dev
branch for GitHub and a private
I don't think there is a way to pick parts of a commit from the same file. I would say you need to simply re-factor your code to move such parts in different files.
BTW, if you want to take some files from a commit, you can use cherry-pick with a combination of other commands as explained here.