2026-01-24

git reset으로 되돌리기

스테이지/히스토리를 되돌리는 reset 흐름을 정리합니다.

Rhio Kim

Rhio Kim

CEO

#git#reset

Page reactions

Leave a quick reaction to this shorts.

반응을 불러오는 중...

!!steps

!duration 180.0

!

_14
# 최신 커밋에 Lightweight 태그 생성
_14
$ git tag v1.0
_14
_14
# 생성된 태그 목록 확인
_14
$ git tag
_14
v1.0
_14
_14
# 태그 상세 정보 확인
_14
$ git show v1.0
_14
commit 6f3e247a9d7e9a4b13e0d24b8a7f3d2e1f2c3b4a
_14
Author: Your Name <your.email@example.com>
_14
Date: Mon Apr 10 15:30:45 2023 +0900
_14
_14
Update example.txt

!!steps

!duration 240.0

!

_16
# 설명이 포함된 Annotated 태그 생성
_16
$ git tag -a v1.1 -m "Release version 1.1"
_16
_16
# Annotated 태그 상세 정보 확인
_16
$ git show v1.1
_16
tag v1.1
_16
Tagger: Your Name <your.email@example.com>
_16
Date: Wed Apr 12 10:00:00 2023 +0900
_16
_16
Release version 1.1
_16
_16
commit 8a9b1c2345b6c7d8e9f0a1b2c3d4e5f6a7b8c9d
_16
Author: Your Name <your.email@example.com>
_16
Date: Tue Apr 11 14:20:15 2023 +0900
_16
_16
New feature implementation

!!steps

!duration 180.0

!

_10
# 과거 커밋 해시로 태그 생성
_10
$ git tag hotfix-0420 abc1234def567890
_10
_10
# 필터링으로 태그 검색
_10
$ git tag -l "hotfix*"
_10
hotfix-0420

!!steps

!duration 240.0

!

_10
# 로컬 태그를 원격 저장소로 푸시
_10
$ git push origin v1.1
_10
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
_10
To https://github.com/username/repository.git
_10
* [new tag] v1.1 -> v1.1
_10
_10
# 모든 태그 일괄 푸시
_10
$ git push origin --tags

!!steps

!duration 180.0

!

_10
# 로컬 태그 삭제
_10
$ git tag -d v1.0
_10
Deleted tag 'v1.0'
_10
_10
# 원격 저장소 태그 삭제
_10
$ git push origin --delete v1.0
_10
To https://github.com/username/repository.git
_10
- [deleted] v1.0