Help with git -- 2

Job ID: 32409649

Budget: $10 – $100 USD

Hi there, I have a large repo with a ~3000 commits. I need to go through each commit and remove all files except for the files that are in 3 specific directories. I work in c# and I can iterate through all commit hashes. I can also delete all of the unwanted files on my own. However, git is confusing for me. My idea is to use a cmd.exe process to make git commands.

I need to know how to git checkout each specific commit and then push/merge any changes I make to that commit to the master (and ultimately to the remote repo).

Can you advise me on those specific commands I should make? Help me work through the project of making these changes to every commit in the repo?
Related categories: C# Programming Git