관리 메뉴

Silver Library (Archived)

Git - How to use reset (back to the previous commit)? 본문

Personal DB

Git - How to use reset (back to the previous commit)?

Chesed Kim 2021. 2. 22. 13:12
반응형

Main Objective.

1. Delete all modified codes since last commit, and return all contions to the last commit point.

 

Note:

Use at your own risk. the option '--hard' will literally revert all your work to the point where you direct.

IF YOU ARE NOT SURE WHAT'S GOING ON, DON'T DO IT!

THIS COMMAND WILL DELETE SOME OF YOUR WORK.

 

How?

git reset --hard HEAD^1 

WARNING:

I HAVE NOT TRIED THIS WAY. Still, this is the way I know thanks to a good programmer.

 


Or you can try this.

git reset --hard input_your_hash_tag_here

e.g. git reset --hard FEGKDS233

 

You can search your hash tag with 'git log' command.

 

Objective complete!

'Personal DB' 카테고리의 다른 글

Python - List, and further (append, remove...)  (0) 2021.02.23
Git - why git push is not working on VSCode?  (0) 2021.02.22
Python - grammar note & example  (0) 2021.02.22
Git - EP 1  (0) 2021.02.20
백엔드의 기본 시각 - 목차  (0) 2021.02.18