Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Undo last commit and amend context menu option #1364
This PR will introduce an "Undo" button that appears only on the most recent commit. Clicking it will do a soft reset to the parent of HEAD, which will restore the staged changes to the state prior to the last commit. The commit message box will be populated with the message of the undone commit.
The amend checkbox will be replaced with a context-menu option that appears only on the most recent commit. Selecting this will run
Note that the commit message and co-author fields are repopulated, and changes from the commit appear back on the stage
Note that you can amend the last commit with any combination of the following:
Write test cases for
This PR makes me happy
This PR breaks a workflow. Previously it was possible to see the changes in the last commit by clicking the amend checkbox. Also it was possible to see what the new commit would look like before amending.
Now if I want to do that, I have to undo the last commit so it goes to the staging area. But if it turns no amend was necessary the last commit is already destroyed. This especially severe when doing interactive rebase because this could lead to an unnecessary rewrite of the complete history even when not amending anything.
It should at least be possible to undo the undo, so I can get the old commit back.
Also I find it far less intuitive to hide the amend feature in a context menu.