Move Git repository to an older commit

There are two ways of doing this and they both work with Git submodules.

git reset --hard <commit-ID>
  • Obviously risky as it will overwrite all local changes in the working directory.
  • Works better when you only depend on Git submodules but don’t make any code changes to them (such as Hugo themes).

Or:

git checkout <commit-ID>