Yesterday in git history appeared commits that should not be there.
Here is an screenshot
It happened because of it was needed to clean files that were under .gitignore
but still were tracked by git. In order to do it we used this answer on SO
https://stackoverflow.com/a/23839198/5709159
And all is works like it should. But we realized that actually not all the files that were under .gitignore
(mistake) should be deleted...
Issue is - that for now these commits were pushed and we need to exclude them (revert)
Are there some ideas how to do it?
Is there a way to take all these files that were deleted (we can see them in commit) and include it again in new commit?
P.S. Files were in git, but then they were deleted and pushed to git. Now we need to get them back.
For example we have such commit history A - B - C - D
. We have some important files in commit A
then in commit B
these files were deleted, then in commit C - D
we make regular commits with logic implementation and so on. So, files that were deleted in commit B
we need to get back. We need to exclude commit B
and leave commits C - D
. Something like this A - C - D
. Or another way is A - B - C - D - B
.