Add new change in previous commit

  1. Find the commit hash you want to edit
git log 
  1. Start interactive rebase, adjust the number if needed git rebase -i HEAD~1

  2. In the editor, change 'pick' to 'edit' for the commit you want to modify

  3. Save and close the editor

  4. Add the new file

git add path/to/newfile 
  1. Amend the commit to include the new file git commit --amend

Save and close the commit message editor

  1. Continue the rebase git rebase --continue

  2. Resolve any conflicts if necessary Force push to the remote repository if needed git push --force