From 79d07279122195f1ee4e87a318906699ac588c98 Mon Sep 17 00:00:00 2001 From: Donne Martin Date: Tue, 18 Aug 2015 07:19:01 -0400 Subject: [PATCH] Added git commands to revert a commit and to undo a push, leaving the local repo intact. --- commands/misc.ipynb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/commands/misc.ipynb b/commands/misc.ipynb index 60c30ea..7a15668 100644 --- a/commands/misc.ipynb +++ b/commands/misc.ipynb @@ -246,6 +246,12 @@ "# Undo a file that has not been added\n", "!git checkout — [target]\n", "\n", + "# Revert a commit\n", + "!git revert\n", + "\n", + "# Undo a push and leave local repo intact\n", + "!git push -f origin HEAD^:master\n", + "\n", "# Undo commit but leave files and index\n", "!git reset --soft HEAD~1\n", "\n",