git submodule - should not have been updated. How to back down

When using "git submodule" I get myself into a new problem I have .gitmodules file within my git project "mainproject"

[submodule "subsystem1"]
  path = subsystem11
  url = /mnt/gitrepos/subsystem1.git/

Starting in my main project I did

$ cd subsystem1
$ git pull origin master

Lets assume that something is really wrong now in "submodule1". I got many updates in, that I did not like to have (right now).

$ cd .. #back in "mainproject"
$ git status  
# On branch master
# Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   subsystem1 (new commits)
#
no changes added to commit (use "git add" and/or "git commit -a")

How can I revert to the version of subsystem1 that I had before pulling?

Answers


Since you haven't committed the changes to the submodule in your main project, git submodule update from the parent repo will revert the submodule to its previous state.


Need Your Help

IOS: Performance of shaders with dynamic branching in OpenGL ES 2.0 vs 3.0

ios performance opengl-es opengl-es-2.0 opengl-es-3.0

I've got an OpenGL ES 3.0 - based IOS app, which I'm going to port to ES 2.0. It contains shaders with a few costly, I guess, loops and ifs. Though the app performs normally on OpenGL ES 3.0-powered