## Git Cheatsheet ``` # Clone a Repository git clone # Stage Changes for Commit git add # Commit Changes git commit -m "Commit message" # Push Changes to the Remote Repository git push # Force Push Changes (use with caution) git push --force # Reset Working Directory to Last Commit git reset --hard # Create a New Branch git branch # Switch to a Different Branch git checkout # Merge Changes from Another Branch git merge # Rebase Changes onto Another Branch (use with caution) git rebase # View Status of Working Directory git status # View Commit History git log # Undo Last Commit (use with caution) git reset --soft HEAD^ # Discard Changes in Working Directory git restore # Retrieve Lost Commit References git reflog # Interactive Rebase to Rearrange Commits git rebase --interactive HEAD~3 ``` --- ##### Follow me for more guides [](https://awscommunity.social/@Ric) [](https://www.linkedin.com/in/richarvey/)