I need to perform major operations on my git repository. I'm not yet sure that I will succeed, and I may need to use methods I'm not yet fully comfortable with. I expect to use a lot of merges, cherry-picks, --reset
, rebases, and hopefully end up in a cleaner state. After I'm done I will push it upstream.
Since I'm not yet sure about the best strategy, I expect some of these operations will lead to dead ends.
No matter what I end up doing, I want to make sure I can always recover the current state for all branches, including possibly deleted local branches and commits.
I have previously used git reflog
to undo premature merges and such, but I'm unsure if that can help me work with deleted branches. Most examples using reflog
seems to apply to specific branches.
Can reflog
help me, and if so, what exactly do I need to remember in order to be able to revert? Is there a better way?