Skip to content

Instantly share code, notes, and snippets.

@AmanRaj1608
Last active November 6, 2020 08:36
Show Gist options
  • Save AmanRaj1608/6b7d4f50424db00ad271722eae9e7440 to your computer and use it in GitHub Desktop.
Save AmanRaj1608/6b7d4f50424db00ad271722eae9e7440 to your computer and use it in GitHub Desktop.
git: Go back to last commits

To change history commits

Rollback to some last hash then change everything then ammend changes to that commit

git reset --hard 7ab8bc40eef3c8a95271152dc1cfb63a0e4318a9
#add files
git add .
git commit --amend --no-edit
git push origin -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment