Git-stash

From Karmaking
Revision as of 19:09, 13 June 2024 by Daniel (talk | contribs) (Created page with "=Git Stash= Stashing acts as a stack, where you can push changes, and you pop them in reverse order. To stash, type git stash Do the merge, and then pull back the stash: git stash pop =Discard the local changes= git reset --hard or: git checkout -t -f remote/branch or discard local changes for a specific file: git checkout filename")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Git Stash

Stashing acts as a stack, where you can push changes, and you pop them in reverse order.

To stash, type

  git stash

Do the merge, and then pull back the stash:

  git stash pop

Discard the local changes

  git reset --hard

or:

  git checkout -t -f remote/branch

or discard local changes for a specific file:

  git checkout filename