Introducing the Revert Button
github.com
github.com
Edit: what I have in mind is something like a Recycle Bin or Trash for deleted branches where you can restore a branch (with a different name, if needed) or delete it permanently. Not some esoteric git feature. I'd like if it were added to git (as an optional feature enabled in .git/config), but I'd want it to work more like stash than a feature for searching for things that were left behind.
Certainly I've force pushed before when I didn't mean to. When I went asking where the reflog was they (politely) offered to dig into my repo and give me a copy of my reflog. But I would have preferred if this was something that I could see easily myself.
It would be neat though if GitHub added some UI magic to recover dangling commits, possibly using the knowledge of which branches previously pointed to them and/or push -f operations.
It's really easy for a branch to "look okay" at the unit level (generally covered by the commit status API) and then completely fail at the integration level.
Enabling quick reverts of bad code encourages people to make the "right fix" rather than trying to hotfix issues in an integration environment (which blocks the rest of the team and prevents other features from going out).
GitHub and SourceTree combined have taken all the pain way from me using git.
This is more for Github's "Enterprise-y" (or "distributed FOSS project-y") workflow, where you have
• a project maintainer, who never touches git, and works entirely through Github, interacting mostly with the issue tracker and only modifying the codebase by accepting/rejecting pull-requests; and
• a set of developers, who actually use git, and generate pull-requests to submit to the maintainer.
Until now, if the non-git-using maintainer accepted a pull-request they shouldn't have, they would have to get one of the developers to create a reverting commit, create a PR for that commit, and then accept the PR. Now they can just revert the PR itself.