rightlocker.blogg.se

Undo local commit
Undo local commit













undo local commit

$ git push origin master 2.2 Using git reset Last but not least push your commit using git push origin command. New commit message If it’s open new editor then add new commit message shown in this screenshotĪfter adding commit message you will see something like below $ git revert b212b080791fc34a9f9f5a6c881b651ccf2c59d7ġ file changed, 0 insertions(+), 0 deletions(-)ģ. # Your branch is up to date with 'origin/master'. # with '#' will be ignored, and an empty message aborts the commit.

undo local commit

# Please enter the commit message for your changes. In case, if it will open the editor for a new commit message then you need to add your commit message and close the editor tab.Īdded new commit message as below at the last line Revert "Bad commit" So you just need to add your new commit message. It will ask you to add a new commit message in your terminal or It might open the editor. We have two commits in our branch, now let’s copy the bad commit ID and run the git revert as below. Let’s see a very simple example for better understanding.ġ.

#UNDO LOCAL COMMIT CODE#

Hash commit id: It is an alphanumeric code that identifies each commit.















Undo local commit