开发者

how to undo git submodule update

I accidentally checked in a wrong submodule update: ( as part of a bigger commit )

-Subpro开发者_StackOverflow社区ject commit 025ffc

+Subproject commit f59250

It is already pushed to the remote..

How do I undo this update?


Run git checkout 025ffc in the submodule directory and then git add SubmoduleName; git commit -m 'Some message' in the main directory.

(Remember that checking out a commit through its hash leaves you in "detached HEAD state", meaning that you're not on any branch. So if there already is a branch pointing to 025ffc in the submodule repository, you should check out that branch; otherwise, you'll probably want to create a branch there and check it out.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜