Skip to content

Instantly share code, notes, and snippets.

View tiagoanleite's full-sized avatar
🏡
Coding mostly from home

Tiago Leite tiagoanleite

🏡
Coding mostly from home
View GitHub Profile
@cutiko
cutiko / Readme.md
Created November 22, 2019 18:24
Git delete last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

ORIGINAL did fork but search didn't helped me

@yblee85
yblee85 / GzipTest.java
Last active January 11, 2024 12:50
java gzip convert string to gzip / gzip to string
package gzip;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.InputStreamReader;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
public class GzipTest {