lithuak
lithuak

Reputation: 6328

How to replace current branch's head with specific commit in git?

If I simply do "checkout some_commit" it will switch me to this commit. But what I need is to stay on the current branch (master to be specific) and totally replace all files in it with files from some_commit. How can I do that?

Upvotes: 9

Views: 5208

Answers (1)

Cascabel
Cascabel

Reputation: 496902

git reset --hard <commit>

(I'm sure this is a duplicate, but don't have time to search.)

Upvotes: 16

Related Questions