So, you committed a change in your local repo and then realized you had the wrong branch? This happens to me a lot and the command I found the most useful for this purpose is:
git reset --soft HEAD^ git reset
Run the above 2 commands and you will have your uncommitted files back. After that you can switch to the right branch and commit them again.
Tags: git commit mistake, git reset commit, git reset last commit, git soft reset, git wrong commit