Skip to content

Instantly share code, notes, and snippets.

@felixrabe
Last active August 29, 2015 14:02
Show Gist options
  • Save felixrabe/9724f6b55e52646e8a03 to your computer and use it in GitHub Desktop.
Save felixrabe/9724f6b55e52646e8a03 to your computer and use it in GitHub Desktop.
gitswap
#!/bin/bash
git branch swap-before &&
git reset head~2 &&
git add -A . && git c -C swap-before &&
git reset --hard swap-before~ &&
git reset head@{1} &&
git add -A . && git c -C swap-before~
@felixrabe
Copy link
Author

I have

[alias]
    c = commit

in my ~/.gitconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment