Well, lets try to answer on your questions:
1. Make sure that the remote does not contain changes in these files.
2. Make sure that the production server also does not contain these files (I already did a pull there)
3. Have the original changes to these two files in my local working tree.
Make sure that the remote does not contain changes in these files
I don't know your SCM vendor. If you have UI service, just open commit's link and explore files.
If you have access to a remote server, you can just:
ssh me@otherhost "cd repo && git log -n 10"
OR
ssh me@otherhost "cd repo && git show --pretty='' --name-only <commit>"
Browse and display files in a git repo without cloning
Make sure that the production server also does not contain these files (I already did a pull there)
You also can connect to a remote production server and find needed commit with
git log --oneline --decorate --oneline --graph <branch>
If you know commit hash on production server, you can use follow
git show --pretty="" --name-only <commit hash>
to get list of changed files
Have the original changes to these two files in my local working tree
So, if your changes were published (commited) and you don't have another local changes (instead just git stash then and git stash list, git stash apply) you just can reset your local HEAD to a previous commit (parent).
git reset --hard HEAD~ #if you didn't create any commits
# If you made some commits after publishing
# You should to rewrite linear history of branch
# Or make revert commit
# Case with rewriting history of your branch, let's name your branch as devel
1. find your published commit, let's name it as `git tag unstable <unstable_published_commit>`
2. Move temp_devel to parent of an unstable - `git branch -f temp_develop unstable~`
3. Checkout on temp_devel - `git checkout temp_devel`
4. "Pull" your changes from unstable commit - `git cherry-pick -n <unstable_commit>` and `git status` and remove unwanted files
5. git commit -m 'Your message'
6. Will be created a new commit with your two files
7. Rewrite history of `devel`, `git rebase -i HEAD devel`
8. You are in an interactive mode right now
9. You can remove or edit some of commits, read an instruction
10. `:wq` in `vim` to save and close your file
11. If rebase will be successful you can publish your `devel` branch with correct commit with two files. Otherwise just run - `git rebase --abort` to return everything as it was.
if you know that you doing at 8 step, than use git rebase --continue to continue your rebase state
It's remove your local changes and indexed changes (be careful with it, use git status to make sure)
You also can use .gitignore file to store list of files or directories to ignore when you adding your changes to an index stage.
if you need your couple files with payload data, you can use git cherry-picn -n <published_commit_hash> to get same changes and exclude unwanted files from index stage with git checkout -- filename or git reset --filename, look at git status help message