I am mastering git. But he did not fully understand his meaning. Is it possible to download the intermediate version of the program? Or simply did the program and then decided that all this is not right, and you need to roll back to several commits and start from there anew?

In addition to github, what other repositories there are so that you can post your projects for free in private, or how can you create your own repository?

2 answers 2

You can get any version of your code by simply rolling back to the desired commit, for example, like this:

git checkout -b <new_branch> <start_point>

Where

new_branch - the name of the local branch;
start_point is the identifier of the commit to which you want to roll back.

On the topic of github analogues is easier to ask in the search. Offhand recall bitbucket and gitorious.

  • You are confusing the person. He does not need a new branch. git checkout <commit_hash> should be quite enough. - pirj
  • @pirj I'm not confusing, in my opinion, it is always better to use a new branch. - a_gura
  • @pirj, if the changes are not yet launched, how to roll back from them? - etki
  • @pirji and other people here, if my answer is about a local branch? What then to do with this thread is a separate question. - a_gura
  • The questioner is interested in how to roll back, and you offer him to roll back in a new branch. What do you think, isn’t it going to be the next question “I’m pushing on the githab, but I don’t see the comit’s interface” because it is pushing to new_branch, and the master branch is still specified on GH? And what should he then do so that the master’s head would then point to the head of a new_branch? Will there be more questions than problems will be solved if you do not advise to create a new branch? - pirj

For hosting, I can advise https://bitbucket.org it is also free as github, but the feature is that you can make a private repository at a free rate.