If you need to restructure your commit history (squash multiple commits into one, remove commits, etc.) use the command (where N is the number of commits to include in the restructure):
git rebase -i HEAD~N
E.g.,
git rebase -i HEAD~3
will let you change the commit history for the last three commits.
If you need to grab a commit from one branch and apply it to the branch you are currently on, use the command:
git cherry-pick COMMIT_HASH
E.g.
git cherry-pick a2cc80d
will let you grab the local commit a2cc80d
and add it to the current branch
commit history.
If you need to grab the changes to a specific file from one branch, use the command:
git checkout BRANCH -- FILENAME
This will take the state of the file from that branch, and apply the changes to the current file. It won't make a new commit.