Предположим, вы изменили файлы в my-branch ~ 3:
git checkout my-branch~3
git checkout HEAD~1 -- some-file.txt some-file2.txt
git commit --amend --no-edit # amend revision, those files will be as they were on previous revision
git cherry-pick my-branch~3..my-branch # rewrite remaining history of branch
# check the branch to make sure everything is of
# if it is... continue with the recipe
git branch -f my-branch #move branch pointer to new rewritten branch
git checkout my-branch
git push --force origin my-branch # adjust name of branch and remote