Search code examples
directorygit-revert

git how to revert to specific revision


I have a git project. I just made a commit, then I deleted some directories. ops, my bad. Now I want to restore those directories that I have deleted. how do I do that?


Solution

  • One way is to use git reset:

    git reset --hard HEAD
    

    This command will discard any working copy changes you have made since the last commit.