May 22, 2019 I have an Amazon EC2 machine. I would like to clone an older version of github repo on this machine. Normally I use git clone How can I clone an older version, say an update from 14 days ago? I can see the exact version I need in the commit history of repository, but do not know how to clone it onto the EC2 machine. I added my repo a second time to see if it would let me have them both and it did. I even added a SmartApp via the “Update From Repo” button with my old name (it worked) and then went to add from the new and it no longer had that app listed, proving that it is connecting to the same repo.
In the short term change to a various cómmit
lf you desire to temporarily go back to it, trick around, then come back again to where you are usually, all you have got to perform is examine out thedesired cómmit:
0r if you need to make commits while you're also there, go forward and create a fresh department while you're also át it:
![How to clone a github repository How to clone a github repository](https://documentation.alphasoftware.com/pages/HowTo/Other/images/aa_gitHub1.png)
Tó go back to where you had been, just check out out the part you were on again. (If you've produced changes,as constantly when changing limbs, you'll possess to offer with them as appropriate. You could reset to zero to toss them apart;you could stash, checkout, stash pop to consider them with yóu; you could dedicate them to a part presently there if you want a branch there.)
Hard delete unpublished cómmits
lf, on the various other hands, you want to actually get rid of éverything you've completed since then, there are two options.One, if yóu haven't published any of these commits, simply reset to zero:
If you mess up, you've already thrown away your regional adjustments, but you can at least get back to where you were before byresetting again.
Undo published commits with new cómmits
0n the other hands, if you've published the function, you probably don't want to reset to zero the part, since that's i9000 effectivelyrewriting history. In that situation, you could indeed revert the cómmits. With Git, révert has a extremely specific meaning: create acommit with the reverse repair to cancel it out. This way you put on't reword any background.
![How How](/uploads/1/2/4/7/124749557/770399302.jpg)
Thé
git-révert
manpage in fact covers a great deal of this in its description.Another useful link is usually this git-scm.com blog site post discussing git-révert.lf you choose you didn't want to go back after all, you can revert the revert (as referred to right here) or reset back to beforethe revert (see the prior area).
You may furthermore discover this solution helpful in this situation:How to proceed HEAD (checkout, revert, reflog, reset to zero)