νμ¬ HEAD μ ν¬μΈνΈλ₯Ό λ³κ²½ν΄ κΈ°λ‘μ μμ νκ±°λ, νΉμ νμΌλ‘ λλ릴 μ μμ
git soft :commit log λ³κ²½μ μ¬μ© git mixed : μμ μμμ λ΄μ© λ³κ²½μ μ¬μ© git hard : μ΄μ λ¨κ³λ‘ λ³κ²½μ μ¬μ©
[test reset1] public class Reset { public static void main(String[] args) { System.out.println("1"); } }
[test reset2] public class Reset { public static void main(String[] args) { System.out.println("1"); System.out.println("2"); System.out.println("3"); } }
λλ²μ commit μ νλ€.
1. git soft
git reset --soft ν΄μκ°
HEAD κ° test reset2 μμ reset1 μΌλ‘ λ³κ²½λμλ€.
2. git mixed
git reset ν΄μκ°
3. git hard
git reset --hard ν΄μκ°
hard λ₯Ό μ¬μ©νλ©΄ commit μ΄μ μΌλ‘ λμκ°λ€.
Share article