Page MenuHomePhabricator

Provide a tool to rewind the push log for a repository
Open, WishlistPublic

Description

If someone --force pushes all your branches away or you thaw --demote your only leader in a cluster configuration, none of your commits are really lost until Git garbage collects them (all the commits are still present in the working copy on disk) but all your branch heads are lost. This is approximately as bad since it makes your data unreachable.

We record a push log which has all the positions of the branch heads, and could reasonably provide a tool to rewind branch heads to a certain point in time. Something like:

$ ./bin/repository rewind rX --date yesterday

This could just print out a series of git branch and git tag statements to restore all your heads to where they were, then you could move forward from there.