Skip to content

Instantly share code, notes, and snippets.

@CagriAldemir
Last active February 26, 2022 21:51
Show Gist options
  • Save CagriAldemir/e2522f1d00ead2eb1993d9c6ace7baac to your computer and use it in GitHub Desktop.
Save CagriAldemir/e2522f1d00ead2eb1993d9c6ace7baac to your computer and use it in GitHub Desktop.

Git Cheat Sheet

Delete Last Commit without Losing the Changes
git reset --soft HEAD^

#If you want to delete from remote;
git push -f
Rebase Current Branch from Another Branch
git pull origin <another-branch-name> --rebase
git push -f

#Example
git pull origin master --rebase
git push -f

Commit to Specific Date

THE_TIME='2013-03-30T8:20:00 -0500' GIT_AUTHOR_DATE=$THE_TIME GIT_COMMITTER_DATE=$THE_TIME git commit -m 'Commit message here'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment