JoHksi
JoHksi

Reputation: 517

Going back to certain previous commit and not modifying git history

I need to go back to certain commit which is 7 commits before my current commit. If I do, I want to change all files to exactly look like previous commit. But I don't want to erase git commit history in github. How do I keep the history and go back to previous state?

Thank you.

Upvotes: 0

Views: 452

Answers (1)

dmitryro
dmitryro

Reputation: 3506

Try this:

 git checkout <commit>

Upvotes: 1

Related Questions