Monday, December 7, 2020

git checkout, revert, reset commits

What is Git? 

A source repository version control system

Why use Git?

Git tracks the changes you make to files, so you have a record of what has been done, and you can revert to specific versions should you ever need to. Git also makes collaboration easier, allowing changes by multiple people to all be merged into one source.

How to checkout special commits?

git log -> show the history commits

git checkout <commit hash>

How to revert to the special commit?

git revert <commit hash>

This command will create a new commit with the “Revert” word in the beginning of the message. 

git push

To fix the detached head do git checkout <current branch> 

How to reset to the special commit?

git reset --hard a1e8fb5


https://www.atlassian.com/git/tutorials/undoing-changes

reset, revert, checkout, clean



No comments:

Post a Comment

API interview questions

  https://www.katalon.com/resources-center/blog/web-api-testing-interview-questions/ Top 50+ Web API Testing Interview Questions [Ultimate l...