i want to revert TILL specific commit in git
i have done 3 commits in git
- 1st commit > 1:am
- 2nd commit > 2:am
- 3rd commit > 3:am
now i want to revert directly to this specific 1st commit !
i want to revert TILL specific commit in git
i have done 3 commits in git
now i want to revert directly to this specific 1st commit !
You can do this to completely remove the unwanted commits from the history:
$ git reset --hard HEAD^^^
However if you want to preserve the history, you should use git-revert
:
$ git revert <sha1-of-3rd-commit> <sha1-of-2nd-commit>
This will apply new commits that revert the old ones.