Reset Commit History
Reset allows you to roll back commit history. The local commit history can be changed by deleting one or more commits and either keeping or discarding the changes.
O (capital 0) in the Magit Status buffer opens the reset menu
||delete the commit, keep the index (staged files) and working directory changes|
||remove the commit, index and working directory changes|
||delete the commit and staged changes (index), keep the working directory|
Specify or select where to reset the commit history to
|Reset HEAD to||Description|
||no change, this is the latest commit|
||first commit before the latest|
||second commit before the latest|
All commits between the current HEAD new HEAD will be removed.
l l shows you the updated commit history.
Changing shared commit history
Avoid reverting shared history when possible, instead consider using revert
-f force option if you must push a changed history to a shared repository
P -f p to force push to a remote repository.