Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
Update fix-shit.md - ## commit to wrong branch
Browse files Browse the repository at this point in the history
  • Loading branch information
3amyatin authored Dec 14, 2023
1 parent 42985f7 commit 6d95971
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions git/fix-shit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ https://docs.gitlab.com/ee/topics/git/numerous_undo_possibilities_in_git/
## undo the last commit
git reset --soft HEAD~

## commit to wrong branch
git switch wront_branch
git reset HEAD~ --soft
git stash
git switch right_branch
git stash pop
git add . # or add individual files
git commit -m "your message here"

## clear index, keep workdir (unstage)
git restore --staged <specific_file>
git reset # completely
Expand Down

0 comments on commit 6d95971

Please sign in to comment.