Say I have two branches. One of them contains a file, and the other contains a slightly modified version of the file. I notice that both files have the same bug in them. Do I have to go into each branch and fix the bug in each version of the file, or is there a way to do this to both files at the same time?
Cherry picking is the way to go for a one-off fix.
The steps would be:
Switch to the other branch
git checkout otherbranch
Cherry-pick the commit that you remembered the hash for:
git cherry-pick COMMIT_SHA
Alternatively, if it's the latest commit for the first branch, you can just put the branch name instead of the hash.