From eb2a0eabe15fb33f96ea60a26d1b583385738e70 Mon Sep 17 00:00:00 2001 From: Erik Cochran Date: Thu, 9 Jan 2020 18:45:50 -0800 Subject: [PATCH 1/3] Update git-branch.md --- git-branch.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/git-branch.md b/git-branch.md index da3ad10a6..87ee9f2f5 100644 --- a/git-branch.md +++ b/git-branch.md @@ -71,3 +71,15 @@ Works for tags, too! ```bash git show-ref HEAD -s ``` +### Reset branch and remove all changes + +```bash +git reset --hard +``` +### Undo commits to a specific commit and push to branch + +```bash +git reset --hard [commitID] +//Now push to your branch +git push --force +``` From b81b7b73c93093b059caceb2498ab6f9facf7d87 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 20 Jan 2020 16:15:24 +1100 Subject: [PATCH 2/3] Update git-branch.md --- git-branch.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/git-branch.md b/git-branch.md index 87ee9f2f5..c35f70ca9 100644 --- a/git-branch.md +++ b/git-branch.md @@ -76,10 +76,12 @@ git show-ref HEAD -s ```bash git reset --hard ``` -### Undo commits to a specific commit and push to branch + +### Undo commits to a specific commit ```bash -git reset --hard [commitID] -//Now push to your branch +git reset --hard $commitID + +# Now push to your branch git push --force ``` From 85ed8e15aa68b8178a1080892636248e4257ed02 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 20 Jan 2020 16:15:41 +1100 Subject: [PATCH 3/3] Update git-branch.md --- git-branch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-branch.md b/git-branch.md index c35f70ca9..bc715c699 100644 --- a/git-branch.md +++ b/git-branch.md @@ -80,7 +80,7 @@ git reset --hard ### Undo commits to a specific commit ```bash -git reset --hard $commitID +git reset --hard $commit_id # Now push to your branch git push --force