diff --git a/git-branch.md b/git-branch.md index 373ba8664..1a98a48db 100644 --- a/git-branch.md +++ b/git-branch.md @@ -79,3 +79,17 @@ 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 + +```bash +git reset --hard $commit_id + +# Now push to your branch +git push --force +```