Eric Eric - 4 months ago 31
Git Question

How do I revert my changes to a git submodule?

I have a git submodule (RestKit) which I have added to my repo.

I accidentally changed some files in there and I'd like to go back to the source version. In order to do that, I tried to run

Mac:app-ios user$ git submodule update RestKit

But as you can see here, this did not work as it is still "modified content":

Mac:app-ios user$ git status
# modified: RestKit (modified content)


Move into the submodule's directory, then do a git reset --hard to reset all modified files to their last committed state. Be aware that this will discard all non-committed changes.