Eine Sache, die Sie verwenden können, ist die reflog
. Im Wesentlichen git reflog
ist wie git log
, aber anstelle von Code-Commits, enthält es alle Aktionen, die man auf die Git-Geschichte des Repo durchgeführt hat.
Zum Beispiel ist hier die letzte reflog von einem meiner Projekte:
1b229a2 [email protected]{0}: commit: Speed up debug mode a little bit
9976a41 [email protected]{1}: commit (amend): Split LooseTire down to gameplay and presentation
b825442 [email protected]{2}: commit: Split LooseTire down to gameplay and presentation
889e828 [email protected]{3}: commit: Add a couple new interfaces
b82965a [email protected]{4}: commit: Move car to the gameplay folder
55360ae [email protected]{5}: commit: Fix a bug when displaying polygon collision shapes
decd93c [email protected]{6}: checkout: moving from 7f06e8fb6bc81566215173b9739b26758a69a82e to master
7f06e8f [email protected]{7}: checkout: moving from df922e5c2efcef3e6fc9566747efe9c79eae23b6 to df922e5c2efcef3e6fc9566747efe9c79eae23b6
df922e5 [email protected]{8}: checkout: moving from master to df922e5c2efcef3e6fc9566747efe9c79eae23b6
Wie Sie sehen gibt es einige Kassen (Teil eines git bisect
ich tat) und einige Commits, sogar ein commit (amend)
. Dies sind alle Aktionen, die in der GIT-Historie des Repos ausgeführt werden.
Mit dieser Anleitung kann ich git reset --hard [email protected]{2}
zum Beispiel, um meine Repo in den Zustand zu bekommen, bevor ich es getan habe git commit --amend
(2. Zeile im Reflog).