Reverting changes to Git submodules

· Thomas Taylor

Reverting a submodule in Git is simple.

How to revert changes to a Git submodule

The cleanest / easiest method of reverting changes to one or many git submodules is by using the following two commands:

1git submodule deinit -f .
2git submodule update --init

The git submodule deinit -f . command “deinitializes” all submodules in the repository.

The git submodule update --init command does a new checkout of them.


Reply to this post by email ↪