E
E
empty_project2019-01-21 21:15:20
git
empty_project, 2019-01-21 21:15:20

How to rollback to another commit?

Let's say there are several commits on GitHub, and I wanted to roll back to one of them. By rollback, I mean the return of all files to their original state. Of course, I was able to make the transition to the commit using git checkout, and then downloaded all the files in the form in which I needed, but is there another way to do this?
Please help, I just started using the git

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
al_gon, 2019-01-21
@empty_project

https://git-scm.com/docs/git-revert.html

R
Ryabos, 2019-01-22
@Ryabos

I would do this:
Clone the repository (git clone ...), switch to the desired commit (git checkout), create a new branch from this commit (git branch -b ...) and make your changes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question