I did a git undo
which was not at all what I wanted. Any now I wonder how to undo the undo AKA redo.
I case you wonder what I wanted to do: I wanted to abandon the local changed (they did not work as expected) and revert to the last committed state.
Update for question 1
A git reset HEAD .
leaves me with:
Auf Branch master
Ihr Branch ist vor 'origin/master' um 2 Commits.
(benutzen Sie "git push", um lokale Commits zu publizieren)
Änderungen, die nicht zum Commit vorgemerkt sind:
(benutzen Sie "git add/rm <Datei>...", um die Änderungen zum Commit vorzumerken)
(benutzen Sie "git checkout -- <Datei>...", um die Änderungen im Arbeitsverzeichnis zu verwerfen)
gelöscht: Pictures/KETTLER_Logo.svg.png
gelöscht: Pictures/Withing_Logo.png
gelöscht: app/src/main/java/com/krischik/fit_import/IMainActivity.java
gelöscht: app/src/main/java/com/krischik/fit_import/IMainFragment.java
geändert: app/src/main/java/com/krischik/fit_import/MainActivity.java
geändert: app/src/main/java/com/krischik/fit_import/MainFragment.java
geändert: app/src/main/kotlin/com.krischik/fit_import/GoogleFit.kt
geändert: app/src/main/res/layout/main_fragment.xml
gelöscht: app/src/main/res/menu/main_menu.xml
geändert: app/src/main/res/values/dimens.xml
geändert: app/src/main/res/values/strings.xml
geändert: app/src/main/res/values/styles.xml
geändert: lib/src/main/kotlin/com.krischik/fit_import/Ketfit.kt
geändert: lib/src/main/kotlin/com.krischik/fit_import/Withings.kt
geändert: lib/src/test/kotlin/com.krischik/fit_import/Ketfit_Test.kt
geändert: lib/src/test/kotlin/com.krischik/fit_import/Withings_Test.kt
geändert: src/main/scripts/Create-IC-Launcher.scala
Unversionierte Dateien:
(benutzen Sie "git add <Datei>...", um die Änderungen zum Commit vorzumerken)
app/src/main/res/anim-v21/
app/src/main/res/anim/
app/src/main/res/drawable-xxxhdpi/
app/src/main/res/values-de/
app/src/main/res/values-v21/
keine Änderungen zum Commit vorgemerkt (benutzen Sie "git add" und/oder "git commit -a")
Obviously reverting to the last committed state should have an clean git status
Update for possible duplication
I don't know how anybody could have had the idea that there was a possible duplicate because the operations in question have nothing in common:
git reset --hard HEAD
changes the work copy to reflect the repository.git undo
changes the repository to undo the last commit.
So while git reset
is part of the answer it has nothing to do with the problem.