Categories

Oct 16, 2019 in Git

Q: In Git, how would you return a commit that has just been pushed and made open?

1 Answer

Oct 16, 2019

One or more commits can be reverted through the use of git revert. This command, in a true sense, creates a new commit with patches that cancel out the changes introduced in specific commits. If in case the commit that needs to be reverted has already been published or changing the repository history is not an option then in such cases, git revert can be used to revert commits. If you run the following command then it will revert the last two commits:

git revert HEAD~2..HEAD

DevOps Training

Alternatively, there is always an option to check out the state of a particular commit from the past and commit it anew.

Click here to read more about GIT
Click here to read more about Insurance

Related questions

Madanswer
Oct 16, 2019 in Git
May 21 in Git
Apr 18 in Git Slack Integration
...