I had committed the changes in git. But, didn't push it. How can i revert my changes from commit.
And is there any chance to stash the single file in git
Can any one please help me
I had committed the changes in git. But, didn't push it. How can i revert my changes from commit.
And is there any chance to stash the single file in git
Can any one please help me
You have basically two options:
To add a new commit to undo, you just need ton run git revert <sha1>
, where <sha1>
is the commit you don't want.
To actually delete this commit you could run
git rebase -i <sha1>^
it will open your text editor with a list of commits. Juste delete the line with the commit you don't want, save, and exit. Git will then rewrite your history, removing this commit.