Checkout old commit and make it a new commit [duplicate]

git rm -r .
git checkout HEAD~3 .
git commit

After the commit, files in the new HEAD will be the same as they were in the revision HEAD~3.

Leave a Comment