Skip to content

Instantly share code, notes, and snippets.

@esedic
Last active January 22, 2024 09:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esedic/62054a1a272cee340abfc6e5277eeb2b to your computer and use it in GitHub Desktop.
Save esedic/62054a1a272cee340abfc6e5277eeb2b to your computer and use it in GitHub Desktop.
Git clone repo at certain commit
Step 1: clone the main repo:
git clone sample.com/component.git
Get inside the cloned repo cd folder_name. Now you have a working directory with latest version pulled
and you want to move back to a specific commit id, here's how you can do it:
Step 2:
git reset --hard 9a36b9e79tbb9132c7 # (takes you back to that commit)
Step 3:
git clean -df # (cleans any untracked files/folders)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment