Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reset commit in SourceTree

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.

like image 335
Roe Avatar asked Mar 01 '16 04:03

Roe


3 Answers

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 revert changes 1. Go to SourseTree terminal
2. Execute the command git reset HEAD~

Then go to file status and check.


like image 127
Charitha Goonewardena Avatar answered Oct 11 '22 02:10

Charitha Goonewardena


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

like image 39
Surendra Reddy Avatar answered Oct 11 '22 02:10

Surendra Reddy


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.

like image 45
MUSTKEEM MANSURI Avatar answered Oct 11 '22 02:10

MUSTKEEM MANSURI