BruteCode
BruteCode

Reputation: 1173

git find missing code?

I made a bugfix and after a few days it disappeared. I don't see it in the branch and doing git log path/to/file doesn't show my changes (are there flags i need for code on different branches?).

How do I ask git what happened to my source if i know the file or date i edited? It could have been ignored/remove due to conflict or something strange. I'm just wondering where it went. Its a 3 line fix and I easily redid it

Upvotes: 2

Views: 406

Answers (1)

Steven
Steven

Reputation: 2275

When everything else fails, you can always try looking at git reflog.

You can look at it as a safety net build into git. It keeps track of all references you checked out or committed in git.

Just type git reflog and see if you can find a reference which contains your change. With git show <hash of reference> you can get more information about a reference or open the hash with your favorit git gui.

More info about git-reflog:

Good luck

Upvotes: 2

Related Questions