IgorDiy
IgorDiy

Reputation: 939

Git remote branch commit

I have forgot to create local branch and was working with remote. After making some changes, i by mistake using Eclipse Git plugin commit this branch in nowhere(obliviously there wasn't local branch). And after that i switched to master, and lost all changes. So how i can restore my changes?

Upvotes: 0

Views: 281

Answers (1)

Romain
Romain

Reputation: 12819

Use git reflog, you'll see previous commit's IDs (in order of commit-time, from most recent to older), and you will then be able to rebase on top of them (or use them like any other commit, that is).

The reflog is the last place you can recover commits that cannot be reached from the tip of any (local) branch, and commits will stay there in the limbo until they are eventually garbage collected, which theoretically could happen any time.

Upvotes: 2

Related Questions