So a long time ago I added a folder abc with a group of files in it to my project and made a commit with revision xyz.
After many commits someone has erased the folder with git rm -r abc.
After this there has been a lot of commits as well.
Now I need to get back the folder abc. I do
git revert xyz
After this I can find folder xyz but not all of the files that were added in the commit xyz are present.
What am I doing wrong? I dont want to do reset because I want to keep the history between commit xyz and the present.
git revert xyzdoes not bring your code back to the state in which it was at revisionxyz– it creates a new commit that undoes whatever was done inxyz. You could trygit cherry-pick --no-commit xyz, which will replay the changes that were done inxyz(if you leave out--no-commit, it will automatically become a new commit, but maybe you don’t want everything that was done inxyz).