Undo mistaken push.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Sat, 03 Mar 2018 15:22:58 +0200
changeset 2232 ac7f6d8bea28
parent 2231 2813a509381c
child 2233 d0c386e6f039
Undo mistaken push.
git.rst
--- a/git.rst	Sat Feb 10 19:24:00 2018 +0200
+++ b/git.rst	Sat Mar 03 15:22:58 2018 +0200
@@ -405,6 +405,18 @@
 * https://stackoverflow.com/questions/5788037/recover-from-git-reset-hard
 * https://stackoverflow.com/questions/14251194/how-to-recover-after-i-execute-git-reset-hard-head
 
+Undo mistaken push
+==================
+::
+
+  $ git reset HEAD^
+  $ git push --force
+
+Alternative commands may look like::
+
+  $ git reset --hard $HASH
+  $ git push -u origin master --force
+
 Git bisect
 ==========