开发者

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

开发者 https://www.devze.com 2023-03-25 01:48 出处:网络
If I simply do \"checkout some_commit\" it will switch me to this commit. But what I need is to sta开发者_StackOverflowy on the current branch (master to be specific) and totally replace all files in

If I simply do "checkout some_commit" it will switch me to this commit. But what I need is to sta开发者_StackOverflowy 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?


git reset --hard <commit>

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号