0

My repository graph looks like spaghetti, mainly due to mistakes with pushing, merging, and so on. I make mistakes more often than I get things right. And there doesn't seem to be an 'undo' functionality, at least not one which is more complicated (and dangerous) than what got me into a mess in the first place.

Are there any git-for-dummies applications that protect a user from his own stupidity? E.g. a dead-simple "undo" functionality, or a feature that allows you to preview a series of changes, and if the result is as desired, that series of actions can be executed?

I'm using Git Extensions at the moment which seems to be the most intuitive for me, but nevertheless. I have a 'test' repository that I use to test actions to make sure the commands I'm about to run do what I think they'll do, but it can take a long time setting things up to be the same as my project's repository that I tend not to bother; and when I do bother, for one reason or another it doesn't always seem to work out the same.

Jodes
  • 14,118
  • 26
  • 97
  • 156
  • You don't say what platform you are on, but on Mac, the Gitup application has a nice undo feature called snapshots. It's sort of like Time Machine, but for git. http://forums.gitup.co/t/using-gitup-snapshots/18 – Dan Lowe Nov 02 '15 at 13:23

2 Answers2

3

The commands that directly work on the repository graph (merge, push and pull) feature a --dry-run option (or an equivalent) which allows you to preview and check the changes before "committing" to them.

In the worst case if you messed something up, there's always the option of using git reset --hard to force your HEAD to a certain point in the tree.

Vogel612
  • 5,620
  • 5
  • 48
  • 73
  • Interesting to know, thanks. I just wish GUIs made better use of that feature. Hopefully I will find a good one that does – Jodes Nov 03 '15 at 12:24
0

As all Git tutorials say - branches are cheap. This means you could use them as a backup tool. Everytime you're not sure what's gonna happen, create a new branch from your current state (git checkout -b new_branch_name) and experiment on it.

MeLight
  • 5,454
  • 4
  • 43
  • 67