From 7c862fd15a66dd3818c3e5b28c248a9de21f3068 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sun, 13 May 2018 19:38:59 +0100 Subject: Add a section on Resetting --- README.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.org b/README.org index 6d06b1d..1c2b4a0 100644 --- a/README.org +++ b/README.org @@ -176,6 +176,27 @@ should say you're ahead of the upstream branch by one commit. Press =P= and then =u= as before to push this new commit. As Git has remembered the upstream branch, you won't need to select it manually. +* Resetting + +** Soft reset + +There are multiple different types of reset actions, one is a soft +reset, this is the default in Magit. + +Press =x= then type =HEAD^= to discard the commit created in the +previous section. Note that a soft reset retains the actual changes +within the commit. + +** Hard reset + +A hard reset will discard both the changes, and the commit. Press =X= +to get the list of reset options, then =h= to select a hard +reset. Enter =test/test-branch= when prompted where to reset to. This +action will have undone the previous reset. + +Perform another hard reset, this time to =HEAD^= like the soft reset, +to get the repository ready for [[*Pulling][Pulling]]. + * Pulling * Interactive rebasing -- cgit v1.2.3