In the case of the likely unlikely event you just created, commit, undo the second commit with git reset HEAD^ , and then add the changes to the first commit with git commit --amend .
In the more likely case, when you moved and commits were at some point in the past, rebasing is your best bet. Not knowing your exact situation, linking to a link that explains it well is probably best.
In both the first and second cases, the Pro Git section of the book on the history of rewriting explains well the parameters, both when using them and when using caution.
6.4 Git Tools - Rewrite History
source share