git submodule

If you want to do this for all submodules, without having to change directories, you can perform

git submodule foreach git reset --hard

You can also use the recursive flag to apply to all submodules:

git submodule foreach --recursive git reset --hard

原文地址:https://www.cnblogs.com/lilei9110/p/3995211.html