I need the state of my repository at a specific commit/date. I don't want to revert back, because I don't want to loose my changes.
How can I get the repository at a specific commit?
I made a research and perhaps the following would work:
git log
git clone /path/to/repository
git checkout dec5f4de67ff32fd ...
Do I get some side-effects between the cloned and the origin repository? Do I have all commits available in my cloned repository? How can I delete the cloned repository? Simply deleting the folder? I don't want a new branch - I only need the project at a specific commit.
Edit:
Now I tried git checkout xxx
. It worked. Then I wanted to get back to my latest changes with git checkout master
. I got the following error
error: The following untracked working tree files would be overwritten by checkout:
Project/Resources/image.png
Please move or remove them
before you can switch branches. Aborting
The reason was that I checked out the wrong branch (not master). Now I deleted all files and used the one from a backup. If I now enter git log
he only shows me the initial commit ... So I moved out of the folder with the console and back in and now he shows me the latest commits.
So be aware of what you checkout.