开发者

How do I delete a branch I created and revert everything back to the master branch's last commit?

The last commit I made to the master branch is where I want to get everything b开发者_运维问答ack to. I made a lot of changes and committed them to a new branch I created called omniauth. I would like to delete this branch entirely and restore everything back to the last master commit. How do I do that?


First you can switch back to the master branch with:

git checkout master

Then you can delete the omniauth branch with:

git branch -D omniauth

Note that the -D option (as opposed to the safer -d) will delete the branch regardless of whether the commits in that branch have been merged into your current branch.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜