commandeffect
git restore –staged <filename>remove last commit from staging
git rebase -i $(git merge-base this-branch main)rebase interactively all commits on this-branch
git reset HEAD~2undo last two commits
git restore filename<br>git checkout – filenameUndo all changes
git blame -L 15,26<br>git log -L 15,26 file-pathlimit commands to a range
git log -S patterncommits that changed specified pattern
git clean -dfXremove untracked files and directories forcefully

Gitlab

commandeffect
git push -o ci.skippush without triggering a pipeline run
git push -o merge_request.createcreate a merge request automatically
git commit –allow empty -m ‘it works!’empty commit e. g. to trigger a build