35

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

-Subproject commit 025ffc
+Subproject commit f59250

It is already pushed to the remote..

How do I undo this update?

1 Answer 1

42

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.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.