Silver Library

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

Personal DB

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

Silver Archmage 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!

0 Comments
댓글쓰기 폼