I have 2 branches master
and bugfix
. my current branch is bugfix
, where I have committed my changes (not pushed), now I need to reset this commit.
If I do reset my commit, will it affect other commits in master
branch?
Actually I want to remove this commit.
git reset --soft 734e3a0
I am using SourceTree.
If you have not pushed your code to remote you can revert your change by following below steps shown as in the image.But please BACKUP your Changes first
1. Go to SourseTree terminal
2. Execute the command git reset HEAD~
Then go to file status and check.
Simply go to Log/History in source tree, select the previous commit of the commit which we you want to undo and right click and do 'Reset current branch to this commit' This will discard your committed changes(which were not pushed).
It won't impact anything in master branch
You need to run this command in source tree terminal git reset --soft HEAD~1
this command push back your commit in your sourtree. then you take latest pull and then you can commit your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With