简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM