Last active
January 22, 2024 09:26
-
-
Save esedic/62054a1a272cee340abfc6e5277eeb2b to your computer and use it in GitHub Desktop.
Git clone repo at certain commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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