Skip to content

Instantly share code, notes, and snippets.

@lftbrts
Last active January 14, 2022 09:35
Show Gist options
  • Save lftbrts/f0afa219a648735ff7795d449d9c4cb7 to your computer and use it in GitHub Desktop.
Save lftbrts/f0afa219a648735ff7795d449d9c4cb7 to your computer and use it in GitHub Desktop.
how to remove files from commit after push
# HEAD~x means going back x commits before HEAD
git reset --soft HEAD~2
# run next cmd for all unwanted files
git reset HEAD path/to/unwanted_file
# squash commit
git commit -c ORIG_HEAD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment