While working on some files, I have created a backup file to each one, but I forgot to erase them before pushing and rebasing. I have committed multiple times since but haven't pushed it yet.
Here were my steps:
git add -A
git commit -m <message>
git checkout master
git pull upstream master
git checkout "branch"
git rebase master
What you could do is to do a soft reset, delete the files, then commit and push.
git logto find the hash of the commit immediately before you added the files
git reset --soft <hash>(inserting the hash of the commit)
Delete any unwanted files
Stage and commit all files.
This will however squash all of the commits that you have made to your branch to a single commit. If this is acceptable to you, then it would be all that you would need. If you would want to preserve all of your commit history, then you could create a new branch before you added the files, then cherry pick the commit that you added the files, but delete the unwanted files before you make the commit, and then commit just the files you wanted to update. After you do this, you can cherry pick any other commits to that branch as well then push.