4

I would like to use GitHub for Windows without sharing the project (well I don't want to pay to get the private project option, and I don't want to share it as open source), so basically use it as a GUI for git. I made a test project to play around with it. I've made some changes and committed them. Now how do I roll back? there's no such option. Maybe I'm blind?

LPeter1997
  • 179
  • 1
  • 9

6 Answers6

3
  1. Click on the cog wheel then click on "Undo most recent commit".Note that this will undo only the last commit if you committed more than once.

  2. Select the repository in the leftmost column and click on the tab "Changes". You will see your changed files on the right. If you right-click on any file you'll have an option to "Discard changes". Click that and all your changes are wiped out and your local files will be back to where they were the last time you made a commit.

  3. repeat point 1 and 2 as many time as you want for all of your commits from the last to the first

bvdb
  • 22,839
  • 10
  • 110
  • 123
Maurizio In denmark
  • 4,226
  • 2
  • 30
  • 64
  • This is the most proper way of doing what the OP inquired about and is functionally similar, although less intuitive, than the previously supported rollback feature. – deadboy Jun 22 '15 at 19:58
1

The latest update removed the "rollback" button. As of now, the best option is to open a Git Shell and rollback manually.

runDOSrun
  • 10,359
  • 7
  • 47
  • 57
0

If you click on the cog wheel, you can click on "Undo most recent commit", which might be what you are after. Be aware though anything in the most recent commit will be gone! No way to get it back as far as I know.

viion
  • 365
  • 2
  • 10
0

I am just learning GitHub as well. The rollback button has been removed in newer version of Github for Windows. We have to go to GitShell and use "git reset ..."

git reset --hard <tag/branch/commit id>

Please check this link How do you roll back (reset) a Git repository to a particular commit for more details.

Community
  • 1
  • 1
Darren Li
  • 381
  • 1
  • 3
  • 6
0

Github for Windows (2018 Version) has a small undo button in the lower left-hand corner showing the most recent commit and an undo button (as long as you have not pushed the change).

enter image description here

Jersey Dude
  • 527
  • 1
  • 5
  • 16
0

In Github for windows version 2.4.1, there is no "rollback" button. Because it will cast away your commit. "Revert" is what you need and do better. Do as following:

  1. Open "History" panel;
  2. Right-click the commit you don't want and choose "Revert this commit";
  3. If it isn't the lastest commit, deal with the Conflict.

So "Revert" will make a new commit. Push it and done.

Luckie Hao
  • 99
  • 4