Git - working on wrong branch - how to copy changes to existing topic branch

Question

I've been working on a project, but unfortunately, I forgot to switch to my branch, and as such have been working on master

How can I copy the work (3 files) I've done here from master, to my branch (called, for example branch123) without comitting to master?

Answer

Sounds like all you need is the following:

git stash
git checkout branch123
git stash apply

Then you should be back on your own branch without touching the master branch.

How do you remove an invalid remote branch reference from Git?

Is it possible to use pip to install a package from a private GitHub repository?