newren / git-filter-repo

Quickly rewrite git repository history (filter-branch replacement)
Other
8.52k stars 708 forks source link

Resotre after --force #606

Closed mihalt closed 1 month ago

mihalt commented 1 month ago

Hi! I've run git filter-repo --force --commit-callback 'commit.committer_date = commit.author_date'. And I see now that reflog was cleared the same as all remote branches. Do you have recommendations how can I restore this quickly?

newren commented 1 month ago

Sure, go restore from your backups. You took some backups before running a command whose manual starts out warning you that you are running a destructive command, and when running with the --force flag which is explicitly documented to ...include immediate pruning of reflogs..., right?

mihalt commented 1 month ago

Sure, go restore from your backups. You took some backups before running a command whose manual starts out warning you that you are running a destructive command, and when running with the --force flag which is explicitly documented to ...include immediate pruning of reflogs..., right?

I would not ask you the question if I did a backup :-) Fortunately I restored .git folder from my ssd history. But I would like to know, is it possible to restore without it too.

newren commented 1 month ago

Sure, go restore from your backups. You took some backups before running a command whose manual starts out warning you that you are running a destructive command, and when running with the --force flag which is explicitly documented to ...include immediate pruning of reflogs..., right?

I would not ask you the question if I did a backup :-) Fortunately I restored .git folder from my ssd history. But I would like to know, is it possible to restore without it too.

No there is not, and there never will be:

But more than all that, if there were an alternate method to restore, why would you have needed to specify the --force flag? Doesn't its existence (and the wording of its documentation) make it pretty clear on its own that there isn't going to be a way to restore?